Running Eclipse on Windows 7 JRE and JDK not found
Solution 1
According to the Eclipse documentation, you may need to specify the VM before the VM args, and the path should not be on the same line as the -vm switch:
- The -vm option and its value (the path) must be on separate lines.
- The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
- The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
For example:
-vm
C:\Java\JDK\1.6\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1024m
You also might need to surround your path with some quotes, since it contains spaces. I always install things like Eclipse and Java in root directories with no spaces, not under Program Files
, to avoid this problem.
Solution 2
Reference the location of your JRE path in the eclipse configuration file, eclipse.ini
.
Note that you only need a JRE to launch Eclipse, but once Eclipse is launched, you should register a JDK for your projects. This is done via
Preferences-> Java -> Installed JREs
john doe
Updated on October 07, 2020Comments
-
john doe over 3 years
I downloaded the latest Eclipse on Windows 7. When I click the eclipse icon it throws the following exception:
I have already installed JRE and JDK.
UPDATE: Eclipse.ini contents:
-startup plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -Dhelp.lucene.tokenizer=standard -Xms40m -Xmx512m -vm C:\Program Files (x86)\Java\jre7\bin
-
john doe almost 11 yearsEclipe.ini is pasted in the original question.
-
john doe almost 11 yearsI dont know where to add the path. Should the path point to the bin folder of the JRE
-
aran almost 11 years-vm C:\yourLocation\jrex.x.x\bin
-
john doe almost 11 yearsI have updated the original question with the latest eclipse.ini contents. Still I get the same error.
-
compski about 9 yearsThx I used this example and it worked: -vm C:\Program Files\Java\jdk1.7.0_40\bin\javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.7 -Xms40m -Xmx512m