|
In this post you will learn how to set the default
JAVA_HOME
in OS X when you have more than one JDK installed in your computer. First you need to run /usr/libexec/java_home -V
command to get the list of installed JDK. The command will print out something like the following depending on the available JDK in your computer.On my machine I have the following version of Java.
Improvements to the Open and Save menus OS X. Default Folder X is added to the Open and Save Mac OS X menus that will save you time. With Default Folder X you’ll have instant access to the folders you use most, thus saving documents in them without having to browse the entire hard drive. It also has a history of frequently used folders. Alternatives to Default Folder X for Windows, Windows Explorer, PortableApps.com, Software as a Service (SaaS), Mac and more. Filter by license to discover only free or Open Source alternatives. This list contains a total of 7 apps similar to Default Folder X. Save your files effortlessly and open your folders instantly.
From the list above pick which version you want to be the default JDK. For example I will choose the
1.8.0_121
version to be my default JDK. To set it run the command below.If the major version of the available JDK is unique you can just use the major version, like:
After setting the JAVA_HOME and you run the
java -version
command you will see that JDK 1.8 is the new default JDK in your computer.Default Folder X 5 1 8 Envelopes
The change above will only active in the current running shell. If you close or terminate the shell, next time you open the shell you will need to set it again. To make this change permanent you need to set it in your shell init file. For example if you are using
bash
then you can set the command in the .bash_profile
. Add the following lines at the end of the file.To activate this configuration right away your can run
source .bash_profile
. This command reads and executes the .bash_profile
in the current shell.Default Folders Windows 10
- How do I convert java.util.TimeZone to java.time.ZoneId? - April 25, 2020
- How do I get a list of all TimeZones Ids using Java 8? - April 25, 2020
- How do I get HTTP headers using HttpClient HEAD request? - April 22, 2020