Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "FAQ How do I run Eclipse?"

(Add the 'eclipse.ini' option to modify eclipse startup configuration)
(OLD: Oracle/Sun VM 1.6.0_21 on Windows)
 
(44 intermediate revisions by 23 users not shown)
Line 1: Line 1:
When you unzip the Eclipse SDK, it creates a base install directory called <tt>eclipse</tt>.
+
== Starting Eclipse  ==
The directory layout looks something like this:
+
 
<pre>
+
When you unzip Eclipse, the directory layout looks something like this:  
  eclipse/
+
<pre>   eclipse/
 
       features/ ''the directory containing Eclipse features''
 
       features/ ''the directory containing Eclipse features''
 
       plugins/ ''the directory containing Eclipse plugins''
 
       plugins/ ''the directory containing Eclipse plugins''
 
       eclipse.exe ''platform executable''
 
       eclipse.exe ''platform executable''
       cpl-v10.html ''the CPL license''
+
       eclipse.ini
      install.ini
+
      eclipsec.exe              ''(windows only) console executable''
      jre/ ''the JRE to run Eclipse with''
+
      epl-v10.html ''the EPL license''
 +
      jre/ ''the JRE to run Eclipse with''
 
       notice.html
 
       notice.html
 
       readme
 
       readme
      startup.jar ''classes needed to start the platform''
+
</pre>  
</pre>
+
You can start Eclipse by running <tt>eclipse.exe</tt> on Windows or <tt>eclipse</tt> 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.  
You can start Eclipse by running <tt>eclipse.exe</tt> on Windows or <tt>eclipse</tt>
+
on other platforms. This small launcher runs a JVM with the following arguments:
+
<pre>
+
  java -cp eclipse/startup.jar org.eclipse.core.launcher.Main
+
</pre>
+
  
 +
Alternatively, you can launch Eclipse by directly invoking the JVM as follows:
 +
<pre>  java -jar eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070606.jar
 +
</pre>
 +
:'''NOTES:'''
 +
:* 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]].
 +
:* When running on '''Java &ge; 9''', you may have to make some non-default system modules available, e.g., by adding <code>--add-modules ALL-SYSTEM</code> to the command line (please check the release notes on supported Java versions per Eclipse version).
  
 +
== Find the JVM  ==
  
If available under the <tt>eclipse/jre</tt> directory, the Eclipse JRE will be used;  
+
If a JVM is installed in the <tt>eclipse/jre</tt> directory, Eclipse will use it; otherwise the launcher will consult the eclipse.ini file and the system path variable. Eclipse '''DOES NOT''' consult the <tt>JAVA_HOME</tt> environment variable.  
otherwise the launcher will consult the <tt>JAVA_HOME</tt> system path variable.
+
To explicitly specify a JVM of your choice, you can use the <tt>-vm</tt> command
+
line argument:
+
<pre>
+
  eclipse -vm c:/jre/bin/javaw.exe
+
</pre>
+
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:
+
<pre>
+
-vm
+
c:/jre/bin/javaw.exe
+
</pre>
+
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..
+
  
 +
To explicitly specify a JVM of your choice, you can use the <tt>-vm</tt> command line argument:
 +
<pre>  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
 +
</pre>
 +
See the [[Equinox Launcher#Finding_a_VM.2C_Using_JNI_Invocation_or_Executing_Java|launcher]] page for more details on specifying a JVM.
  
You should always use <tt>-vm</tt> so you can be sure of what VM you are using.
+
== eclipse.ini  ==
Installers for other applications sometimes modify the <tt>JAVA_HOME</tt> variable,
+
thus changing the VM used to launch Eclipse without your knowing about it.
+
  
 +
The '''most recommended''' way to specify a JVM for Eclipse to run in is to put startup configuration into the <code>[[eclipse.ini]]</code> file in the same folder as the Eclipse executable (<code>eclipse.exe</code> on Windows). 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, include the -vm argument in <code>[[eclipse.ini]]</code>, for example:
 +
<pre>-vm
 +
c:/jre/bin/javaw.exe
 +
</pre>
 +
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 <code>[[eclipse.ini]]</code> configuration file.
  
The first time the <tt>eclipse</tt> command is executed,
+
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 system path variable, thus changing the VM used to launch Eclipse without your knowing about it.  
the platform creates a workspace directory, such as <tt>eclipse/workspace</tt>. 
+
The workspace will contain all your projects, along with private metadata
+
computed by various plug-ins.  
+
  
 +
'''''The format of the <tt>eclipse.ini</tt> file is very particular; it is strongly recommended to read '''''[[eclipse.ini|'''''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 <tt>-data &lt;workspace-path&gt;</tt> command-line argument.
  
 +
== See Also:  ==
  
In Eclipse 3.0, you are prompted to choose a workspace location on start-up.
+
*[[FAQ How do I increase the heap size available to Eclipse?]]
Previously, the platform stored the workspace in the Eclipse install directory
+
*[[FAQ How do I increase the permgen size available to Eclipse?]]
by default.  In all versions of Eclipse, you can manually specify the workspace
+
*[[FAQ Who shows the Eclipse splash screen?]]
location on the command line, using the <tt>-data &lt;workspace-path&gt;</tt>
+
*[http://www.eclipse.org/swt/launcher.html The Eclipse Program Launcher]
command-line argument. The easiest way to quickly start Eclipse on different
+
*[http://wiki.eclipse.org/index.php/Category:Equinox Equinox Wiki Category]
workspaces for versions before Eclipse 3.0 is to create shortcuts or shell
+
*Running Eclipse 3.3M5+
scripts for each launch.
+
The use of <tt>-data</tt> is advised because using the default workspace location
+
will make it much more difficult for you to upgrade to new versions of Eclipse.
+
  
 +
:*[[Starting Eclipse Commandline With Equinox Launcher]]
 +
:*[[Automated PDE JUnit Testing With Eclipse 3.3M5]]
  
 +
*[http://www.64bitjungle.com/ubuntu/install-java-jre-160-update-x-on-hardy-as-the-default-java-runtime Preparing for Eclipse in Linux: Installing JRE 1.6.0 (Update x) as the Default Runtime]
  
 +
<br>
  
 +
----
  
== See Also: ==
+
<font size="-2">This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
  
[[FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F]]
+
== User Comments  ==
  
[http://www.eclipse.org/swt/launcher.html The Eclipse Program Launcher]
+
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.  
  
[[FAQ_Who_shows_the_Eclipse_splash_screen%3F]]
+
Specifying -vm "c:\program files\..." seems to work for galileo.
  
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
+
A comment on the JVM search order (on Windows) - My testing (Windows 7, Eclipse 3.4.1) shows that Eclipse also looks for a JVM in the registry, in my case HKLM\Software\Wow6432Node\JavaSoft\Java Runtime Environment. I believe the correct search order would be 1: eclipse/jre directory, 2: eclipse.ini file, 3: registry, 4: System path variable. Can anyone else confirm this? If that is the case I think the text above should be updated.

Latest revision as of 11:23, 8 January 2024

Starting Eclipse

When you unzip 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''
       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. 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
NOTES:
  • 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.
  • When running on Java ≥ 9, you may have to make some non-default system modules available, e.g., by adding --add-modules ALL-SYSTEM to the command line (please check the release notes on supported Java versions per Eclipse version).

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 <workspace-path> command-line argument.

See Also:



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.

Specifying -vm "c:\program files\..." seems to work for galileo.

A comment on the JVM search order (on Windows) - My testing (Windows 7, Eclipse 3.4.1) shows that Eclipse also looks for a JVM in the registry, in my case HKLM\Software\Wow6432Node\JavaSoft\Java Runtime Environment. I believe the correct search order would be 1: eclipse/jre directory, 2: eclipse.ini file, 3: registry, 4: System path variable. Can anyone else confirm this? If that is the case I think the text above should be updated.

Back to the top