The former seems to work when Java 8 is listed first the latter when Java 11 is first. Depending on which one I have listed first in my Path variable, I get different results when i run java -version or java -version. In my case, that helped me determine that I have java.exe and javac.exe at C:\Program Files (x86)\Common Files\Oracle\Java\javapath and C:\Program Files\Common Files\Oracle\Java\javapath. And it doesn't change even if I point my JAVA_HOME to JDK 11. You can determine which version of the JDK is the default by entering java -version in a Terminal window. There can be multiple JDKs installed on the macOS system. That's despite java -version showing version 11.0.15. Determining the Default JDK Version on macOS When starting a Java application through the command line, the system uses the default JDK. Seems like java -version used to be a way to do this, but no longer.Īdding to the complexity, you can also supposedly get your Java version info from Control Panel > Programs > Java > About. (I'm not even sure where the version 11 it found came from possibly from when I installed maven.)ĭetermining the difference between the JRE and JDK you're running has never been straightforward. Java Runtime Environment JRE 10.0.2 / 8.0 Update 331 / 9.0.4 / Java Development Kit 20.0 / 19.0.2 / 18.0.2.1 / 17.0.2 / 16.0.2 / 15.0.1 / 14.0.2 / 13.0.2 / 12.0.2 / 11.0.7 / 10 / 8.0 Update 361 / 9.0.4 / jPortable (Java Portable) 8 Update 101 Win/Mac/Linux/Portable. This is confusing because my Java compiles (e.g., via mvn) use JDK 8 since that's what my JAVA_HOME is pointing to. Note for comparison that java -version does not reflect my JAVA_HOME location and in fact shows java version 11 instead of 8: C:\Users\me> java -version For example, the 3rd line here reflects my JAVA_HOME location, where I'm pointing to JDK 8: C:\Users\me> where javaĬ:\Program Files\Common Files\Oracle\Java\javapath\java.exeĬ:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exeĬ:\Program Files\Java\jdk1.8.0_202\bin\java.exe This lists any and all locations of java.exe, including from your JAVA_HOME. To get your jdk location in Windows, run this at a command prompt: JDK 8 and JRE 8 Installation Start Here This page gives access to instructions for installing the JDK and JRE on Oracle Solaris, Windows, Linux, and OS X computers.
0 Comments
Leave a Reply. |