Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "FAQ How do I run Eclipse?"
(Clarified that the default launcher uses the JVM that's on your path) |
(Update for 3.3) |
||
Line 1: | Line 1: | ||
+ | == Eclipse 3.3 == | ||
When you unzip the Eclipse SDK, it creates a base install directory called <tt>eclipse</tt>. | When you unzip the Eclipse SDK, it creates a base install directory called <tt>eclipse</tt>. | ||
The directory layout looks something like this: | The directory layout looks something like this: | ||
Line 6: | Line 7: | ||
plugins/ ''the directory containing Eclipse plugins'' | plugins/ ''the directory containing Eclipse plugins'' | ||
eclipse.exe ''platform executable'' | eclipse.exe ''platform executable'' | ||
− | + | eclipse.ini | |
− | + | eclipsec.exe ''(windows only) console executable'' | |
− | jre/ | + | epl-v10.html ''the EPL license'' |
+ | eclipse.ini | ||
+ | jre/ ''the JRE to run Eclipse with'' | ||
notice.html | notice.html | ||
readme | readme | ||
− | |||
</pre> | </pre> | ||
You can start Eclipse by running <tt>eclipse.exe</tt> on Windows or <tt>eclipse</tt> | You can start Eclipse by running <tt>eclipse.exe</tt> on Windows or <tt>eclipse</tt> | ||
− | on other platforms. This small launcher essentially | + | on other platforms. This small launcher essentially finds and loads the JVM that is on your PATH. |
+ | On Windows, the eclipsec.exe console executable can be used for improved command line behaviour. | ||
Alternatively, | Alternatively, | ||
you can launch Eclipse by directly invoking the JVM as follows: | you can launch Eclipse by directly invoking the JVM as follows: | ||
<pre> | <pre> | ||
− | java - | + | java -jar eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070606.jar |
</pre> | </pre> | ||
− | '''NOTE:''' | + | '''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 3.3 launcher, see [[Starting Eclipse Commandline With Equinox Launcher]]. |
+ | === 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 the equivalent classes are in the org.eclipse.equinox.launcher bundle. | ||
+ | |||
+ | To start 3.2 by directly invoking the JVM use the following command: | ||
+ | <pre> | ||
+ | java -cp eclipse/startup.jar org.eclipse.core.launcher.Main | ||
+ | </pre> | ||
+ | Eclipse 3.2 did not contain a console version of the executable. | ||
+ | |||
+ | == Find the JRE == | ||
If available under the <tt>eclipse/jre</tt> directory, the Eclipse JRE will be used; | If available under the <tt>eclipse/jre</tt> directory, the Eclipse JRE will be used; | ||
− | otherwise the launcher will consult the <tt>JAVA_HOME</tt> | + | otherwise the launcher will consult the system path variable. Eclipse will <b>NOT</b> consult the <tt>JAVA_HOME</tt> environment variable. |
+ | |||
To explicitly specify a JVM of your choice, you can use the <tt>-vm</tt> command | To explicitly specify a JVM of your choice, you can use the <tt>-vm</tt> command | ||
line argument: | line argument: | ||
<pre> | <pre> | ||
− | eclipse -vm c: | + | 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 | ||
+ | eclipse -vm c:\jre\bin ''look for Java in the jre/bin directory | ||
</pre> | </pre> | ||
+ | |||
+ | See the [[Equinox_Launcher#Finding_a_VM.2C_Using_JNI_Invocation_or_Executing_Java|launcher]] page for more details on specifying a JVM. | ||
+ | |||
+ | === Specifying the JVM in Eclipse 3.2=== | ||
+ | Eclipse 3.2 was not able to using the JVM shared library to load the VM in the Eclipse process. The only way to specify the JVM to use in 3.2 was to specify the java(w).exe: | ||
+ | eclipse -vm C:\jre\bin\javaw.exe | ||
+ | |||
+ | == eclipse.ini == | ||
Another option is to put startup configuration into an <code>[[eclipse.ini]]</code> file. The Eclipse program launcher will read arguments from either the command-line or the configuration file named <code>[[eclipse.ini]]</code>. To specify a JVM using configuration file, create a text file named <code>[[eclipse.ini]]</code> in the same folder as <code>eclipse.exe</code> with these contents: | Another option is to put startup configuration into an <code>[[eclipse.ini]]</code> file. The Eclipse program launcher will read arguments from either the command-line or the configuration file named <code>[[eclipse.ini]]</code>. To specify a JVM using configuration file, create a text file named <code>[[eclipse.ini]]</code> in the same folder as <code>eclipse.exe</code> with these contents: | ||
<pre> | <pre> | ||
Line 39: | Line 64: | ||
You should always use <tt>-vm</tt> so you can be sure of what VM you are using. | You should always use <tt>-vm</tt> so you can be sure of what VM you are using. | ||
− | Installers for other applications sometimes modify the | + | Installers for other applications sometimes modify the system path variable, |
thus changing the VM used to launch Eclipse without your knowing about it. | thus changing the VM used to launch Eclipse without your knowing about it. | ||
Revision as of 12:21, 5 July 2007
Contents
Eclipse 3.3
When you unzip the Eclipse SDK, it creates a base install directory called eclipse. The directory layout looks something like this:
eclipse/ features/ ''the directory containing Eclipse features'' plugins/ ''the directory containing Eclipse plugins'' eclipse.exe ''platform executable'' eclipse.ini eclipsec.exe ''(windows only) console executable'' epl-v10.html ''the EPL license'' eclipse.ini jre/ ''the JRE to run Eclipse with'' notice.html readme
You can start Eclipse by running eclipse.exe on Windows or eclipse on other platforms. This small launcher essentially finds and loads the JVM that is on your PATH. On Windows, the eclipsec.exe console executable can be used for improved command line behaviour.
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 3.3 launcher, see Starting Eclipse Commandline With Equinox Launcher.
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 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.
Find the JRE
If available under the eclipse/jre directory, the Eclipse JRE will be used; otherwise the launcher will consult the system path variable. Eclipse will 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 eclipse -vm c:\jre\bin ''look for Java in the jre/bin directory
See the launcher page for more details on specifying a JVM.
Specifying the JVM in Eclipse 3.2
Eclipse 3.2 was not able to using the JVM shared library to load the VM in the Eclipse process. The only way to specify the JVM to use in 3.2 was to specify the java(w).exe:
eclipse -vm C:\jre\bin\javaw.exe
eclipse.ini
Another option is to put startup configuration into an eclipse.ini
file. 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, create a text file named eclipse.ini
in the same folder as eclipse.exe
with these contents:
-vm c:/jre/bin/javaw.exe
Eclipse now will launch without additional arguments in the command-line, with the JVM specified in the eclipse.ini
configuration file. Windows users: please be sure that the file you created has .ini extension, you may need to uncheck the 'Folder Options:View:Hide file extensions for known file types' from the Windows Explorer's Tools menu..
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 first time the eclipse command is executed, the platform creates a workspace directory, such as eclipse/workspace. The workspace will contain all your projects, along with private metadata computed by various plug-ins.
In Eclipse 3.0, you are prompted to choose a workspace location on start-up. Previously, the platform stored the workspace in the Eclipse install directory by default. In all versions of Eclipse, you can manually specify the workspace location on the command line, using the -data <workspace-path> command-line argument. The easiest way to quickly start Eclipse on different workspaces for versions before Eclipse 3.0 is to create shortcuts or shell scripts for each launch.
The use of -data is advised because using the default workspace location will make it much more difficult for you to upgrade to new versions of Eclipse.
See Also:
- FAQ How do I increase the heap size available to Eclipse?
- FAQ How do I increase the permgen size available to Eclipse?
- FAQ Who shows the Eclipse splash screen?
- The Eclipse Program Launcher
- Equinox Wiki Category
- Running Eclipse 3.3M5+
This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.
User Comments
The -data option does not work if a relative path is specified. If this is true, please point it out the FAQ above. Thank you.