天天看点

Eclipse无法打开,一闪而过的解决方法

双击eclipse图标之后,常见的那个对话框一闪而过,然后eclipse也没有进一步的响应。通过上网查找发现是以下原因所致:

打开windows的cmd后,尝试着键入java命令。得到如下的exception:

Error occurred during initialization of JVM, java/lang/NoClassDefFoundError:java/lang/Object.

很奇怪,为啥之前配置好好的java 类路径发现确出现了问题。

下面是解决方法:

1. 如果你是admin权限,ctrl+F 然后搜索java.exe,如果有找到位于C:/WINDOWS/system32 系统文件夹中存在java.exe, javaw.exe etc.全部删除。应该可以解决问题。

2. 如果你没有admin权限,无法对C系统盘进行操作。但是你对eclipse的文件夹有操作权限,则打开eclipse文件夹中的,eclipse.ini 文件。

-vmargs 之前添加

-vm "java.exe 的绝对路径"(例如:C:/java/jdk/bin/java.exe)

3. 或者直接在快捷图标的目标中加入:-vm "C:\jdk1.6.0\bin\javaw.exe" 参数。

指定javaVM 后eclipse就可以正常运行了。

起因:

调用java命令时,windows将会从环境变量中找寻这个命令。

猜测系统文件夹的优先级总是比较高的,高于指定的JAVA_HOME.

当你的C:/WINDOWS/system32中存在java.exe的时候,第一个找到的java.exe肯定是系统文件夹里的,所以无论你重装eclipse或者重装jdk都没有特别的效果。

但是当你指定jvm的路径时可以跳过这个java.exe, 而找到真正的java.exe。所以指定路径后一切问题解决。

那么为什么会有java.exe 等文件出现在system32 文件夹下呢?以下是别人发帖及回复:

RE: Why is java.exe in System32?

Eclipse无法打开,一闪而过的解决方法

22nd Apr, 2009 18:01Score: 5

Posts: 71

User Since: 1st Apr 2009

System Score: 100%

Location: Atlanta, US

 One or more programs which you installed came bundled with an older version of Java. Assuming that you have the latest Java installed, you can delete java.exe in \system32 or in \system if found there too. Do a rescan with Secunia to see if there is one other old Java file which you need to delete, and where it is located, usually either in \system or \system32.RE: Why is java.exe in System32?

Eclipse无法打开,一闪而过的解决方法
Eclipse无法打开,一闪而过的解决方法
Eclipse无法打开,一闪而过的解决方法

One or more programs which you installed came bundled with an older version of Java. Assuming that you have the latest Java installed, you can delete java.exe in \system32 or in \system if found there too. Do a rescan with Secunia to see if there is one other old Java file which you need to delete, and where it is located, usually either in \system or \system32.  

继续阅读