eclipse 不工作 - 未找到 java 虚拟机
我在 mac osx 10.6 上安装了 eclipse 和 netbeans 我安装了 android sdk,一切正常。
现在我安装了mac ports 并使用 macports 安装 ImageMagick
现在重新启动系统后,netbeans 和 eclipse 都不起作用。
Net beans 关闭时没有任何错误。和 eclipse 给出以下错误:
必须安装 JDK 或 JRE 运行eclipse的命令没有java virtual 搜索后发现机器 以下位置: /用户....../eclipse.app 目录MacOS/jre/bin/java 你中的java 当前路径
我认为问题可能出在路径上。
所以我尝试从终端运行 java 和 javac 。但这两个命令运行正常。
注意:我没有 javaw(我不确定 mac 中是否有这个文件。
我可以知道可能是什么问题以及如何修复它吗?
I installed eclipse and netbeans on mac osx 10.6
I installed android sdk and everything was working perfectly.
Now I installed mac ports
and installed ImageMagick using macports
Now after restarting the system neither netbeans work nor eclipse.
Net beans closes without any error. and eclipse give following error :
A JDK or JRE must be installed in
order to run eclipse No java virtual
machine is found after searching the
following location:
/Users....../eclipse.app
ContentsMacOS/jre/bin/java java in you
current PATH
I thought the problem might be with the path.
So I tried running java and javac from terminal. But these two commands run properly.
note: I don't have javaw (I am not sure whether we have this file in mac or not.
Can I know what can be the problem and how can I fix it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
在 Eclipse.app/Contents/MacOS/eclipse.ini 文件中放在
前面
应该有所帮助,我希望......我希望
In the Eclipse.app/Contents/MacOS/eclipse.ini file put
right before
should help, I hope ... I hope
检查您的 Eclipse 目录 - 并在 eclipse.ini 中查找以下行:
您可能错过了这一行
Check your Eclipse directory -- and look in eclipse.ini for this line:
You're probably missing that
对于较新版本:Mac OS X El Capitan 版本 10.11.6 当前 Java 版本的路径是:
对于 Eclipse Neon.1,打开 eclipse.ini 文件
并将 vm 参数更新为:
就在之前
For newer versions: Mac OS X El Capitan Version 10.11.6 path to current Java version is:
For Eclipse Neon.1 open the eclipse.ini file from
and update the vm argument to:
just before
对我来说,使用 -vm 更新 eclipse.ini 没有帮助。相反,我必须使用以下内容更新 Eclipse.app/Contents/info.plist(将
$Actual Java location$
替换为 java 的位置:For me updating the eclipse.ini with -vm did not help. Rather, I had to update Eclipse.app/Contents/info.plist with below content(replace
$Actual Java location$
with location of java:适用于 Windows 7 - 64 位用户(也可能适用于其他用户)
您可以执行以下操作
1.如果尚未安装java Runtime(请注意,它不会与Android SDK一起安装,您需要单独下载)。您可以从这里下载 http://www.oracle.com/technetwork/ java/javase/downloads/index.html(在三个选项中选择“Java Platform (JDK) 7u21”第一个按钮:))
安装后,您将在“ C:\Program Files ( x86)\Java\jre6\bin"
2. 设置环境变量,步骤如下
a) 右键单击计算机,选择属性,选择“高级系统设置”
b) 在“高级”选项卡下选择最后一个按钮“环境变量”
c) 在接下来出现的窗口中的“系统设置”下搜索“路径”
d) 选择“路径”,单击编辑
e) 添加“;” C:\Program Files (x86)\Java\jre6\bin'(此路径或您计算机中安装的任何路径,分号用于分隔其他预先存在的路径变量,无需引号;) )
就这样 !!现在尝试运行 Eclipse.exe(注意:如果您已按照某些建议在 eclipse.ini 中添加了该条目..请删除它,否则它将引发另一个异常)
记住无需更改eclipse.ini
它的工作原理只需双击 eclipse.exe :)
For windows 7 - 64 bit users ( may work for others too )
you may do the following
1. If the java Runtime is NOT already installed, (Note it does not get installed along with Android SDK, you need to download it separately ). You can download from here http://www.oracle.com/technetwork/java/javase/downloads/index.html (select 'Java Platform (JDK) 7u21' out of the three option the first button :) )
after install you will find javaw.exe in " C:\Program Files (x86)\Java\jre6\bin"
2. set the environment variable the steps as below
a) Right click Computer, select properties, select 'advance system setting'
b) Under Advanced tab select the last button 'Environment Variable'
c) Under System settings in the window that comes next search for 'Path'
d) select 'Path' click edit
e) Add the '; C:\Program Files (x86)\Java\jre6\bin' (this path or which ever path its installed in your machine, semi colon is used to separate other pre-existing path variables, and no need of quote ;) )
Thats all !! Now try running Eclipse.exe ( note : if you have added the entry in eclipse.ini as suggested by some ..please remove it else it will throw another exception)
Remember no need to change the eclipse.ini
It works Just double click the eclipse.exe :)
好的。所以我确实将
`-vm
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java`
添加到 eclipse.ini 文件中,但当我重新启动 Eclipse 时它总是被覆盖。
所以,我所做的事情是:
mkdir -p jre/Contents/Home/jre/bin/
cd jre/ Contents/Home/jre/bin/
ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/ java
之后 Eclipse 每次都能工作!
希望这有帮助:)
OK. So I did add
`-vm
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java`
to eclipse.ini file but it was always overwritten when I restarted the Eclipse.
So, the thing I have done is:
mkdir -p jre/Contents/Home/jre/bin/
in main eclipse foldercd jre/Contents/Home/jre/bin/
ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
And after that Eclipse works every time!
Hope this helps :)
在 Eclipse 中转到 Windows -->偏好设置 --> Java -->安装了 JRE,并查看其中是否提到了任何 JRE。
In eclipse Go to Windows --> Preferences --> Java --> Installed JRE's and see whether any JRE in mentioned there.
警告:我对Mac一无所知,所以YMMV。
检查您的 JAVAHOME 环境变量。在大多数系统上,这就是 JRE 将其位置广播给想要在当前 JRE 下运行的应用程序的方式。
Caveat: I don't know anything about the Mac, so YMMV.
Check your JAVAHOME environment variable. On most systems, that is how the JRE broadcasts its location to apps that want to run under the current JRE.
在 Java.com 上下载脱机可执行文件,并确保您的系统是 32 位还是 64 位,您应该下载适合您的系统的文件。安装 Java 后尝试运行 eclipse,它应该可以运行。
Download the offline executable file on Java.com and make sure that if your system is 32-bit or 64-bit you should download the one that is appropriate with your system. After installing Java try running eclipse and it should run.
从“高级系统设置”转到“环境变量”。
添加 JAVA_HOME 变量(用户变量和系统变量)和 value=“jre 的路径”示例:“
C:\Program Files\Java\JDK_1.8\jre\bin
”。将 jre 路径添加到“Path”变量“
...; C:\Program Files\Java\JDK_1.8\jre\bin
”。然后就可以了。
如果仍然有问题,请将 jre 目录复制到 Eclipse IDE 应用程序工作的路径。
Go to "environment variables" from "advance system settings".
Add JAVA_HOME variable (both user and system variables) and value= "path of jre" example: "
C:\Program Files\Java\JDK_1.8\jre\bin
".Add jre path to "Path" variable "
...; C:\Program Files\Java\JDK_1.8\jre\bin
".Then it works..
If still there is a problem, copy jre directory to path where Eclipse IDE Application works.
通过终端启动 eclipse 对我有用。尝试一下。
Launching eclipse via terminal worked for me. Try that.
@大家非常感谢。
两次重新启动后它有些或如何工作不知道为什么..
感谢并抱歉给您带来麻烦
@all thanks a lot.
It some or how works after two restarts don no why..
Thanks and sorry for the trouble