简体   繁体   中英

Start Eclipse on MacOS from Java Command line

I'm working with an older version of Eclipse, Helios SR1.

I need to be able to start eclipse from the terminal.

In review of http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F

I execute the following command in Terminal to start eclipse.

/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -jar plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar

and I get

Root exception: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError

So this appears to be more complex than what was found in the above link. If I double-click the Eclipse.app it starts right up.

I'm wondering what else needs to be done to allow the Command Line Eclipse Launcher to work properly

You should just be able to use the open command:

open /path/to/eclipse.app

or

open -n /path/to/eclipse.app

will open a new instance of Eclipse even if one is already running.

If you must use the Java command you need to specify -XstartOnFirstThread before the -jar option:

java -XstartOnFirstThread -jar ...

Use the eclipse launcher binary:

<Your-Install-Path>/Eclipse.app/Contents/MacOS/eclipse

Default start-up options are set in eclipse.ini:

<Your-Install-Path>/Eclipse.app/Contents/Eclipse/eclipse.ini

Kepler start-up options are documented here: https://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html (Helios link redirects to Kepler, the oldest one they have kept available)

The launching process is explained in detail here: https://help.eclipse.org/2019-03/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/launcher.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM