I'm using Eclipse on Windows and I don't understand why it's using a specific java version. I can check the java version using by Eclipse doing this Help -> About Eclipse -> Installation Details -> Configuration. The java.home is set to C:\Program Files\Java\jre1.8.0_65. But my environment variables are configured like this :
Why Eclipse is not using C:\java\jdk1.8.0_60 as java.home.
The JAVA_HOME
environment variable is not supposed to be the same the java.home
system property. JAVA_HOME
is an OS-level environment setting, while java.home
is a Java-level property that's established by the JVM when it starts; it indicates the root (home) of the JRE that is currently running (which very well might be different than where you pointed JAVA_HOME
to).
The reason you're not getting the value for java.home
that you expect is probably because you have not specified to Eclipse what JVM you want it to run in (which is separate from the Installed JREs you see in the Preferences). Follow the instructions for specifying the JVM in eclipse.ini
, point it to the JDK location you want (C:\java\jdk1.8.0_60
according to your example above), then Eclipse will report that as the value of java.home
(since that will be the JVM that's running Eclipse itself).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With