无法运行 Eclipse 应用程序。甚至无法启动 Eclipse IDE
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1042824/
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
Not able to run Eclipse Application. Can't even start Eclipse IDE
提问by Real Red.
I have an RCP product which doesn't run. Then I installed Eclipse freshly, and when I open Eclipse.exe it doesn't open Eclipse IDE. I get the error: NoClassDefFoundError: com/mercury/javashared/agentloader/AgentBootstrap (Please see complete trace below).
我有一个无法运行的 RCP 产品。然后我重新安装了 Eclipse,当我打开 Eclipse.exe 时,它没有打开 Eclipse IDE。我收到错误:NoClassDefFoundError: com/mercury/javashared/agentloader/AgentBootstrap(请参阅下面的完整跟踪)。
System has latest jdk,jre installed. What could be the reason for that error? (PS: The same eclipse archieve when unzipped on a different machine works fine). I am able to run eclipse and my eclipse rcp product there)
系统安装了最新的jdk,jre。该错误的原因可能是什么?(PS:在不同的机器上解压缩时相同的日食档案工作正常)。我可以在那里运行 eclipse 和我的 eclipse rcp 产品)
!ENTRY org.eclipse.osgi 4 0 2009-06-25 10:40:19.468
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: com/mercury/javashared/agentloader/AgentBootstrap
at org.eclipse.swt.widgets.Display.<init>(Display.java:393)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:448)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at org.eclipse.ui.internal.ide.IDEApplication.createDisplay(IDEApplication.java:122)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:75)
at org.eclipse.core.internal.runtime.PlatformActivator.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.ClassNotFoundException: com.mercury.javashared.agentloader.AgentBootstrap
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 17 more
UPDATE:I had QTP (Quick Test Pro) installed on the machine. When I uninstalled QTP now I am able to both RCP product and Eclipse.exe.
更新:我在机器上安装了 QTP(Quick Test Pro)。当我现在卸载 QTP 时,我可以同时使用 RCP 产品和 Eclipse.exe。
Now, whats the relation between QTP and Eclipse? I want both to coexist.
现在,QTP 和 Eclipse 之间的关系是什么?我要两者共存。
回答by VonC
Then I installed Eclipse freshly, and when I open Eclipse.exe it doesn't open Eclipse IDE
The same eclipse archive when unzipped on a different machine works fine
然后我重新安装了 Eclipse,当我打开 Eclipse.exe 时它没有打开 Eclipse IDE
在不同的机器上解压缩时相同的 eclipse 存档工作正常
That should mean a workspace issue: eclipse try to recreate a view for which the jar is missing.
Try to launch your eclipse with '-clean' option, and making sure it does reference a fresh new workspace (with the -data
option, like illustrated in this eclipse.ini)
这应该意味着工作区问题:eclipse 尝试重新创建缺少 jar 的视图。
尝试使用“-clean”选项启动您的日食,并确保它确实引用了一个全新的工作区(使用该-data
选项,如此eclipse.ini 中所示)
This questionillustrated a clean start:
这个问题说明了一个干净的开始:
eclipse.exe -clean --launcher.ini path\to\my_eclipse.ini
Regarding QTP, check this article from IBM, which describes a similar situation.
关于QTP,查看IBM的这篇文章,描述了类似的情况。
In this scenario HP Mercury Quick Test Pro Professional v9.3 was installed and the following Microsoft Windows XP User and System Environmental variables were present:
在这种情况下,安装了 HP Mercury Quick Test Pro Professional v9.3,并且存在以下 Microsoft Windows XP 用户和系统环境变量:
IBM_JAVA_OPTION and _JAVA_OPTION
Each was set to:
每个设置为:
-Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar
or more explicitly:
或更明确地说:
-Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QuickTest Professional\bin\java_shared\classes;C:\PROGRA~1\HP\QuickTest Professional\bin\java_shared\classes\jasmine.jar
Note: HP Mercury Diagnostic Tool is another product that used these environment variables in the past. Contact HP Support if up to date information and support is needed on their products.
However it is important to stress the focus is on these environment variables being used dangerously by any vendor product or any software or user in general setting them directly
Resolving the problem
Delete or clear the values of theIBM_JAVA_OPTION
and_JAVA_OPTION
variables.After deleting/clearing the environment variables, it should be possible to start Rational Application Developer or other IBM SDK for Java (== JDK) based product.
Note: Deleting or clearing these variables may prevent the other products (such as the aforementioned HP products) from working.
Warning: Deleting or clearing or changing
IBM_JAVA_OPTION
or_JAVA_OPTION
should be done with caution if these are needed settings. There are legitimate and safe uses of these environment variables to set JVM options.
注意:HP Mercury Diagnostic Tool 是过去使用这些环境变量的另一种产品。如果需要有关其产品的最新信息和支持,请联系 HP 支持。
然而,重要的是要强调重点是这些环境变量被任何供应商产品或任何软件或用户危险地使用,通常直接设置它们
解决问题
删除或清除IBM_JAVA_OPTION
和_JAVA_OPTION
变量的值。删除/清除环境变量后,应该可以启动 Rational Application Developer 或其他基于 IBM SDK for Java (== JDK) 的产品。
注意:删除或清除这些变量可能会阻止其他产品(如上述 HP 产品)工作。
警告:如果需要这些设置,删除或清除或更改
IBM_JAVA_OPTION
或_JAVA_OPTION
应谨慎进行。这些环境变量可以合法且安全地用于设置 JVM 选项。
If this is indeed the case, that reminds me of my answer to the question:
如果确实如此,那让我想起我对这个问题的回答:
"Why doesn't the Java SDK installer set JAVA_HOME?"
“为什么 Java SDK 安装程序不设置 JAVA_HOME?”
;)
;)
If you want both eclipse and QTP to coexist, you need to make sure any running configuration you may have (in or outside eclipse) needing to run "with" QTP are the scripts which set those extra variables (_JAVA_HOME or other).
If those variables are set globally (by the QTP installation process itself)... bad things can happens.
如果您希望 eclipse 和 QTP 共存,您需要确保您可能拥有(在 eclipse 内部或外部)与 QTP 一起运行的任何运行配置都是设置这些额外变量(_JAVA_HOME 或其他)的脚本。
如果这些变量是全局设置的(由 QTP 安装过程本身)......坏事可能会发生。
回答by Donald
Check the JAVA_TOOL _OPTIONS variable. It probably has a value of "-agentlib:jvmhook". Clear the variable and Eclipse based products should start working.
检查 JAVA_TOOL _OPTIONS 变量。它的值可能是“-agentlib:jvmhook”。清除变量,基于 Eclipse 的产品应该开始工作。
You'll probably need to update your HP QT launcher to set this variable when you want to do profiling.
当您想要进行分析时,您可能需要更新您的 HP QT 启动器以设置此变量。
回答by Donald
i know this question has been asked a long before,i am answering because if somebody later views this question then they will get idea how to do it
as @java programmer said ,eclipse looks for the default location C:\Java\jdk1.6.0_33\jre\bin\javaw.
我知道很久以前就有人问过这个问题,我正在回答,因为如果有人后来查看这个问题,那么他们就会知道如何按照@java 程序员所说的去做,eclipse 会寻找默认位置 C:\Java\jdk1.6.0_33\jre\bin\javaw.
you can also manually set the path if your java is installed in some other path. the way is simple search for eclipse.ini file and open it with wordpad. Now search for "open file" below that write the full path for the javaw. see the screen shot. for example if your java is installed in c drive then the full path for javaw would be
如果您的 java 安装在其他路径中,您也可以手动设置路径。方法很简单,搜索 eclipse.ini 文件并用写字板打开它。现在搜索下面的“打开文件”,写下 javaw 的完整路径。看屏幕截图。例如,如果您的 java 安装在 c 驱动器中,那么 javaw 的完整路径将是
C:\Program Files\Java\jdk1.6\bin\javaw.exe
now save the file eclipse.ini and now double click on eclipse.exe. It will run .
现在保存文件 eclipse.ini,然后双击 eclipse.exe。它会运行。
回答by user7856586
I had the same error. So, I found next solution :
我有同样的错误。所以,我找到了下一个解决方案:
Go to folder with eclipse.exe. and open configuration file
After that delete line "-vmargs" and add Your path to JDK (In my occasion is C:\Program Files\Java\jdk1.7.0_79\bin)
- Now Your eclipse should start normally.
回答by Ramesh
create a batch file clearing the variables and run the RAD.
创建一个清除变量的批处理文件并运行 RAD。
set IBM_JAVA_OPTIONS=
set _JAVA_OPTIONS=
set JAVA_TOOL_OPTIONS=
"C:\Program Files\IBM\RAD85\eclipse.exe" -product com.ibm.rational.rad.product.v85.ide
回答by Nash
QTP installation mess up with classpath of many applications.
QTP 安装弄乱了许多应用程序的类路径。
Recommending setup a batch file to run each time so the global setup is not modified.
建议设置一个批处理文件每次都运行,这样全局设置就不会被修改。
set IBM_JAVA_OPTIONS=
set _JAVA_OPTIONS=
set JAVA_TOOL_OPTIONS=
cd [your eclipse.exe]
eclipse.exe
Save it as .bat file and double click to run. You should see the eclipse working.
保存为.bat文件,双击运行。你应该看到日食在工作。
回答by user3928464
Check if virtual machine is running properly or not. If not uninstall and re-install jdk.
检查虚拟机是否正常运行。如果没有卸载并重新安装jdk。
回答by Quest
I have faced the same issue. Uninstall all the java version you have on your machine from control panel. Then re-install the java and try launching eclipse. it works for me.
我遇到了同样的问题。从控制面板卸载您机器上的所有 Java 版本。然后重新安装java并尝试启动eclipse。这个对我有用。
回答by Quest
if eclipse is not running for example when you double click on the eclipse.exe then the eclipse appears for few seconds and disappears,in this case go to command prompt then migrate to eclipse folder and type eclipse -vm C:\Java\jdk1.6.0_33\jre\bin\javaw.It is because eclipse by default looks for this path.In my case it is running after i made this way.if your jdk is installed in program files then from program files copy the java folder and past in c drive.
如果 eclipse 没有运行,例如当你双击 eclipse.exe 时,eclipse 会出现几秒钟然后消失,在这种情况下,转到命令提示符,然后迁移到 eclipse 文件夹并键入 eclipse -vm C:\Java\jdk1。 6.0_33\jre\bin\javaw。这是因为eclipse默认查找此路径。在我的情况下,它在我这样做后运行。如果您的jdk安装在程序文件中,则从程序文件中复制java文件夹并过去c盘里。
回答by ATorras
I think that the problem could be that the mercury "bundle" is somehow referenced but not in the classpath.
我认为问题可能在于汞“捆绑包”以某种方式被引用,但不在类路径中。