简体   繁体   English

从Java命令行在MacOS上启动Eclipse

[英]Start Eclipse on MacOS from Java Command line

I'm working with an older version of Eclipse, Helios SR1. 我正在使用旧版本的Eclipse Helios SR1。

I need to be able to start eclipse from the terminal. 我需要能够从终端启动Eclipse。

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

I execute the following command in Terminal to start eclipse. 我在终端中执行以下命令以启动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 根异常: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. 如果我双击Eclipse.app,它将立即启动。

I'm wondering what else needs to be done to allow the Command Line Eclipse Launcher to work properly 我想知道还需要做些什么才能使命令行Eclipse启动器正常工作

You should just be able to use the open command: 您应该只能够使用open命令:

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. 即使一个新的Eclipse实例已经在运行,它也会打开它。

If you must use the Java command you need to specify -XstartOnFirstThread before the -jar option: 如果必须使用Java命令,则需要在-jar选项之前指定-XstartOnFirstThread

java -XstartOnFirstThread -jar ...

Use the eclipse launcher binary: 使用Eclipse启动器二进制文件:

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

Default start-up options are set in eclipse.ini: 默认的启动选项在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) 开普勒的启动选项记录在这里: https ://help.eclipse.org/kepler/index.jsp ?topic= /org.eclipse.platform.doc.isv/reference/misc/runtime- options.html (Helios链接重定向到开普勒,这是他们保留的最古老的开普勒)

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 此处详细说明了启动过程: https : //help.eclipse.org/2019-03/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/launcher.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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