在 mac os x 中从终端运行 eclipse
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33088426/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
running eclipse from terminal in mac os x
提问by Glassjawed
I've been trying to run eclipse from my mac os x terminal and I'm getting the error that no such eclipse command is found. I added the directory to my PATH variable and I'm able to run this just fine on linux, just not on mac osx.
我一直在尝试从我的 mac os x 终端运行 eclipse,但我收到了没有找到这样的 eclipse 命令的错误。我将该目录添加到我的 PATH 变量中,并且我能够在 linux 上运行它,但不能在 mac osx 上运行。
Anyone know why this is?
有谁知道这是为什么?
回答by greg-449
Eclipse is a Mac Application (like Mail.app) rather than a simple executable so you open it from Terminal using the open
command:
Eclipse 是一个 Mac 应用程序(如 Mail.app)而不是一个简单的可执行文件,因此您可以使用以下open
命令从终端打开它:
open /Applications/eclipse.app
This is assuming you are using Eclipse Mars or later, earlier versions of Eclipse have a different path.
这是假设您使用的是 Eclipse Mars 或更高版本,早期版本的 Eclipse 有不同的路径。
回答by tsamaya
I have a bin folder at my user root folder. This folder is added to my PATH env variable in my .bash_profile
我的用户根文件夹中有一个 bin 文件夹。此文件夹已添加到我的 .bash_profile 中的 PATH 环境变量
Then I have an ~/bin/eclipse file. this file is executable (chmod +x ~/bin/eclipse)
然后我有一个 ~/bin/eclipse 文件。这个文件是可执行的 (chmod +x ~/bin/eclipse)
it contains open /Path/To/Eclipse.app
它包含打开的 /Path/To/Eclipse.app
Hope this help
希望这有帮助