2009-06-25 169 views
5

我有一个无法运行的RCP产品。然后我新安装Eclipse,当我打开Eclipse.exe时,它不会打开Eclipse IDE。我收到错误:NoClassDefFoundError:com/mercury/javashared/agentloader/AgentBootstrap(请参阅下面的完整跟踪)。无法运行Eclipse应用程序。甚至无法启动Eclipse IDE

系统已安装最新的jdk,jre。什么可能是这个错误的原因? (PS:在不同的机器上解压缩时,同样的eclipse实现工作正常)。我能够运行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$1.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: 我有QTP(快速测试专业版)的计算机上安装。当我现在卸载QTP时,我可以同时使用RCP产品和Eclipse.exe。

现在,QTP和Eclipse之间的关系是什么?我希望两者共存。

+0

@RCB:感谢您的反馈。在您正确安装QTP之后,如果该产品已更改或设置了一些与Java相关的环境变量,那么检查一下会很有趣。你甚至可以重新发布你的反馈和一些额外的细节(关于环境变量的值)作为答案(如果你愿意,可以选择它作为官方答案) – VonC 2009-06-25 19:26:27

回答

8

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尝试重新创建一个视图,其中缺少该jar。
尝试推出以“-clean”选项,并确保它引用一个全新的工作空间(与-data选项,就像这个eclipse.ini所示)

This question说明干净启动您的Eclipse:

eclipse.exe -clean --launcher.ini path\to\my_eclipse.ini 

关于QTP,请查看这篇文章from 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:

IBM_JAVA_OPTION and _JAVA_OPTION 

每个被设置为:

-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 

或更明确:

-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 the IBM_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.


如果确实如此,那REM INDS我,我回答这个问题的:

Why doesn’t the Java SDK installer set JAVA_HOME?

;)


如果你想Eclipse和QTP共存,您需要确保所有正在运行的配置,你可以有(在eclipse中或在eclipse外面)需要运行“与”QTP是设置这些额外变量(_JAVA_HOME或其他)的脚本。
如果这些变量是全局设置的(通过QTP安装过程本身)...坏事情可能发生。

+1

嗨,谢谢你的详细解释。在我看来,在安装QTP之前,Java(jdk + jre)在安装之前并不合适。看到eclipse失败后,我再次安装了java,但没有任何帮助。然后,当我再次安装并安装QTP时,这意味着QTP现在安装在具有适当Java(jdk + jre)的机器上。这次安装后,每个人都像平常一样开始工作。 – 2009-06-25 10:45:26

+0

任何人都知道是否有办法让Java(或Eclipse)忽略JAVA_TOOL_OPTIONS变量......或者可能将agentlib值替换为不会导致干扰的值? – 2011-08-11 17:52:21

+1

@david:你可以尝试在[`eclipse.ini`]中将它们定义为“”(http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse/3275659#3275659),因为vm参数(`-DJAVA_TOOL_OPTIONS =“”`) – VonC 2011-08-11 17:56:16

0

我认为这个问题可能是水银“捆绑”以某种方式引用但在classpath中。

3

检查JAVA_TOOL的_OPTIONS变量。它可能具有“-agentlib:jvmhook”的值。清除变量和基于Eclipse的产品应该开始工作。

当您想进行性能分析时,您可能需要更新HP QT启动程序以设置此变量。

0

如果eclipse没有运行,例如当你双击eclipse.exe然后eclipse出现几秒钟然后消失,在这种情况下转到命令提示符,然后迁移到eclipse文件夹并输入eclipse -vm C:\ Java \ jdk1.6.0_33 \ jre \ bin \ javaw.It是因为默认情况下寻找这条路径。在我的情况下,它运行后,我做了这种方式。如果您的jdk安装在程序文件,然后从程序文件复制Java文件夹和过去在C盘。

2

我知道这个问题已经很久之前问了,我回答,因为如果有人后来认为这一问题,那么他们将得到的想法如何做到这一点 作为@java程序员说,日食查找默认位置C:\Java\jdk1.6.0_33\jre\bin\javaw.

如果您的java安装在其他路径中,您也可以手动设置路径。方法很简单 搜索eclipse.ini文件并用写字板打开它。 现在搜索“打开文件” ,下面写着javaw的完整路径。 看到屏幕截图。 例如,如果你的java安装在c盘则javaw进程的完整路径将是

C:\Program Files\Java\jdk1.6\bin\javaw.exe 

现在保存文件的eclipse.ini 和现在的eclipse.exe双击。 它会运行。

enter image description here

0

如果Eclipse不能例如在运行,当你在的eclipse.exe双击,然后Eclipse中出现几秒钟,并消失:

  1. 转到环境变量
  2. 清除Java选项和IBM。
  3. 尝试打开Eclipse。
1

创建批处理文件清除变量并运行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 
1

QTP安装与许多应用程序的类路径相混淆。

推荐设置一个批处理文件以便每次运行,这样全局设置就不会被修改。

set IBM_JAVA_OPTIONS= 
set _JAVA_OPTIONS= 
set JAVA_TOOL_OPTIONS= 

cd [your eclipse.exe] 
eclipse.exe 

将其保存为.bat文件并双击运行。你应该看到日食工作。

0

检查虚拟机是否正常运行。如果不是卸载并重新安装jdk。

0

我遇到了同样的问题。从控制面板卸载您机器上的所有Java版本。然后重新安装java并尝试启动eclipse。这个对我有用。

0

我有同样的错误。所以,我发现下一个解决方案:

  1. 转到与eclipse.exe文件夹。开放的配置文件

    enter image description here

  2. 是删除行 “-vmargs”,并添加到你的JDK路径后(在我的场合是C:\ Program Files文件\的Java \ jdk1.7.0_79 \ BIN)

    enter image description here

    1. 现在您的eclipse应该可以正常启动。