Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Eclipse on Windows 7 JRE and JDK not found

Tags:

java

eclipse

jvm

I downloaded the latest Eclipse on Windows 7. When I click the eclipse icon it throws the following exception:

enter image description here

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
like image 437
john doe Avatar asked May 23 '13 14:05

john doe


People also ask

How do I fix error a JRE or JDK must be available in order to run Eclipse Mac?

Add the -vm flag to fix the Eclipse JRE or JVM must be available error. And that's it. Make the change, save the file, and then re-run the Eclipse installer. The Eclipse “No Java virtual machine was found” error will go away, and the Eclipse IDE will be successfully installed on your desktop.

Does Eclipse Need JRE or JDK?

Eclipse is a Java-based application and, as such, requires a Java Runtime Environment or Java Development Kit (JRE or JDK) in order to run.

Which version of Eclipse is compatible with Java 7?

Developers can now use Eclipse JDT to develop Java applications that take advantage of the new Java 7 features. The new Eclipse JDT release will include the following for Java 7 support: Eclipse compiler implements all the new Java 7 language enhancements.


2 Answers

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.

Source: Eclipse Wiki

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.

like image 72
Nate Avatar answered Sep 26 '22 14:09

Nate


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
like image 40
aran Avatar answered Sep 22 '22 14:09

aran