Question

I develop plugins (to be honest I started not so long time ago) and test my plugins on different Eclipses. I have Eclipse 3.4, 3.5, 3.6 installed. in C:\Program Files\Java there are:

  • jdk1.5.0_22
  • jdk1.6.0_21
  • jre1.5.0_22
  • jre6

for all versions of Eclipses, in here (Windows -> Preferences -> Installed JREs) there is "jdk1.5.0_22" with the path "C:\Program Files\Java\jdk1.5.0_22"


So, can not figure out why for Eclipse 3.5 and 3.6 this

 System.getProperty("java.home")

prints

C:\Program Files\Java\jdk1.5.0_22\jre

but in Eclipse 3.4 it prints

C:\Program Files\Java\jre6

Could anyone give me a glue which value is used by System.getProperty("java.home")?

Was it helpful?

Solution 3

Here, there is explanation how to solve similar problem http://tech.karolzielinski.com/m2eclipse-eclipse-is-running-in-a-jre-but-a-jdk-is-required In my case it was enough to add -vm option to eclipse.ini file for Eclipse 3.4.

-vm
C:\Progra~1\Java\jdk1.5.0_22\jre\bin\javaw

Thanks everyone!

OTHER TIPS

You can check your Project Build Path:

Example: alt text

The java.home property returns the Java installation directory. In Windows, this is set either with the JAVA_HOME environmental variable or in the eclipse.ini file. It could be also given as a command parameter in the eclipse.exe.

You can read some instructions about running eclipse here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top