If the major version of the available JDK is unique you can just use the major version, like: export JAVA_HOME=`/usr/libexec/java_home -v 1. For example, I will choose the 1.8.0_121 version to be my default JDK. Matching Java Virtual Machines (3):ĩ, x86_64: "Java SE 9" /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Homeġ.8.0_121, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Homeġ.7.0_80, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Homeįrom the list above pick which version you want to be the default JDK. On my machine I have the following version of Java. Search for Java Build Path and select the JRE under Libraries. The command will print out something like the following depending on the available JDK in your computer. Click with the right button on the project and choose Properties. First you need to run /usr/libexec/java_home -V command to get the list of installed JDK. These steps apply equally to all other JDK and JRE releases. Note: These steps use the JDK 8u231 macOS installer as an example. Determining the Default JDK Version on macOS When starting a Java application through the command line, the system uses the default JDK. In this post you will learn how to set the default JAVA_HOME in Mac OS X when you have more than one JDK installed in your computer. The following steps show you how to install a non-notarized JDK or JRE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |