Eclipse startup error : JRE/JDK must be available

好久不见. 提交于 2019-12-12 00:08:28

问题


Downloaded latest eclipse for Java EE Opened... error .. opening...JRE/JDK must be available for running eclipse.. Unlike normal my java is installed in G:/ Do I have to make any changes to ecplise.ini in -vm tag ? Like adding java jdk bin path ? Did not work somehow ! Any idea ?


回答1:


Eclipse looks at PATH variable for choosing which JRE to use, if that is configured eclipse will work correctly, if you don't have or want to point eclipse to a specific Java Installation then you can provide following argument in eclipse.ini

-vm
G:\Java

You can see different runtime options available here.




回答2:


You can start Eclipse by running eclipse.exe on Windows or eclipse on other platforms. This small launcher essentially finds and loads the JVM. On Windows, the eclipsec.exe console executable can be used for improved command line behavior.

Alternatively, you can launch Eclipse by directly invoking the JVM as follows:

java -jar eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070606.jar NOTE: The version of org.eclipse.equinox.launcher in the above command must match the version actually shipped with Eclipse. For more details on launching Eclipse using Java (not eclipse.exe) with the launcher, see Starting Eclipse Commandline With Equinox Launcher.

Find the JVM

If a JVM is installed in the eclipse/jre directory, Eclipse will use it; otherwise the launcher will consult the eclipse.ini file and the system path variable. Eclipse DOES NOT consult the JAVA_HOME environment variable.

To explicitly specify a JVM of your choice, you can use the -vm command line argument:

eclipse -vm c:\jre\bin\javaw.exe ''start Java by executing the specified java executable eclipse -vm c:\jre\bin\client\jvm.dll ''start Java by loading the jvm in the eclipse process See the launcher page for more details on specifying a JVM.

eclipse.ini

The most recommended way to specify a JVM for Eclipse to run in is to put startup configuration into the eclipse.ini file in the same folder as the Eclipse executable (eclipse.exe on Windows). The Eclipse program launcher will read arguments from either the command-line or the configuration file named eclipse.ini. To specify a JVM using configuration file, include the -vm argument in eclipse.ini, for example:

-vm c:/jre/bin/javaw.exe Note: there are no quotes around this path as would be required when executing the same from the command-line were the path to contain white space, etc. This is a common mistake when using Windows.

Eclipse now will launch without additional arguments in the command-line, with the JVM specified in the eclipse.ini configuration file.

You should always use -vm so you can be sure of what VM you are using. Installers for other applications sometimes modify the system path variable, thus changing the VM used to launch Eclipse without your knowing about it.

The format of the eclipse.ini file is very particular; it is strongly recommended to read eclipse.ini and follow the examples there.

When Eclipse starts, you are prompted to choose a workspace location on start-up. This behavior can be configured in the Preferences. You can manually specify the workspace location on the command line, using the -data command-line argument.

OLD: Starting Eclipse 3.2

In Eclipse 3.2 and earlier, there was an additional file in the root of Eclipse: startup.jar. This jar file contained the classes needed to start the platform. In 3.3 and above the equivalent classes are in the org.eclipse.equinox.launcher bundle.

To start 3.2 by directly invoking the JVM use the following command:

java -cp eclipse/startup.jar org.eclipse.core.launcher.Main

Eclipse 3.2 did not contain a console version of the executable.

OLD: Oracle/Sun VM 1.6.0_21 on Windows

The Eclipse 3.3 - 3.6 launchers for Windows had a problem with the Oracle/Sun Java VM version '1.6.0_21-b06'.

UPDATE: Oracle/Sun have released a respin of their JDK/JRE to fix this, so the recommended resolution of this problem is to download and re-install version 1.6.0_21-b07'. Make sure you have b07 or higher by running java -version.

Before the fix was released, there were three choices to work around this:

1----switch back to '1.6.0_20' (as of July 19, 2010 it can still be downloaded here) Change the commandline for launching or add the following line after "-vmargs" to your Eclipse.ini file: -XX:MaxPermSize=256m (Detailed instructions/examples)http://wiki.eclipse.org/Eclipse.ini

2----For 32-bit Helios, download the fixed eclipse_1308.dll and place it into (eclipse_home)/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503(https://bugs.eclipse.org/bugs/attachment.cgi?id=174640)

{The Java bug was closed for voting and comments at 6969236 on the Java BugParade because the change has been reverted; the related Eclipse bug report is open for voting and comments at bug 319514.}



来源:https://stackoverflow.com/questions/11007611/eclipse-startup-error-jre-jdk-must-be-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!