Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
OpenJDK Cookbook

You're reading from   OpenJDK Cookbook Over 80 recipes to build and extend your very own version of Java platform using OpenJDK project

Arrow left icon
Product type Paperback
Published in Jan 2015
Last Updated in Feb 2025
Publisher
ISBN-13 9781849698405
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
 Kobylyanskiy Kobylyanskiy
Author Profile Icon Kobylyanskiy
Kobylyanskiy
 Mironchenko Mironchenko
Author Profile Icon Mironchenko
Mironchenko
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Getting Started with OpenJDK FREE CHAPTER 2. Building OpenJDK 6 3. Building OpenJDK 7 4. Building OpenJDK 8 5. Building IcedTea 6. Building IcedTea with Other VM Implementations 7. Working with WebStart and the Browser Plugin 8. Hacking OpenJDK 9. Testing OpenJDK 10. Contributing to OpenJDK 11. Troubleshooting 12. Working with Future Technologies 13. Build Automation Index

Configuring OpenJDK on Windows

Although the initial configuration is sufficient for most tasks, it may still be required to do some configuration. In the case of OpenJDK, this is performed by setting system variables. Here we will touch only on the case that often occurs when JDK is unpacked manually—how to set it as default.

Getting ready

To follow this recipe, we will need an OpenJDK instance installed on our Windows system. Windows 7 or Windows 8 will be best, because Windows XP is already officially discontinued by Microsoft.

How to do it...

At first, we need to install our OpenJDK implementation as the default Java instance. This is often necessary for development:

  1. In order to do so, we will go to Start | Control Panel | System | Advanced | Environment Variables | User Variables (or System Variables for system-wide configuration) and add the path to the Java executable to the PATH system variable, as shown:
    How to do it...

    Tip

    If there are other paths to other Java executables, we may need to delete them as well, but it will be better to remember them, since we may need to restore our old default Java settings.

  2. If we were installing OpenJDK from unofficial builds, there may be no need to change the PATH variable at all.
  3. To validate our newly configured variable, we will go to the Command Prompt and type the following:
    java -version
  4. The expected output is the version of our newly installed build.

How it works…

In order to set a newly installed OpenJDK instance as the default JDK, we need to change the system variable. After that change, our Java executables will be visible to the system.

There's more...

The same procedure is followed to set the CLASSPATH variable. It is not very necessary, and if you are using other libraries such as GNU classpath, you probably know about it.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
OpenJDK Cookbook
You have been reading a chapter from
OpenJDK Cookbook
Published in: Jan 2015
Publisher:
ISBN-13: 9781849698405
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon