5

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).

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)

!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: 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.

Now, whats the relation between QTP and Eclipse? I want both to coexist.

Real Red.
  • 4,991
  • 8
  • 32
  • 44
  • @RCB: thank you for this feedback. It would be interesting to check, after your correct installation of QTP, if that product has changed or set some Java-related environment variables. You could even re-post your feedback and some additional details (about the values of environment variables) as an answer (and choose it, if you want, as the official one) – VonC Jun 25 '09 at 19:26

12 Answers12

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

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)

This question illustrated 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.

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

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


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?"

;)


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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Hi, thanks for detailed explaination. It seems to me that initially before installing QTP, Java(jdk+jre) that was present was not proper. After seeeing the eclipse failure I installed java again but that was of no help. Then, when I unistalled and installed QTP again it meant that QTP now installed on a machine having proper Java (jdk+jre). And this time after installation everyting started working as normal. – Real Red. Jun 25 '09 at 10:45
  • Anyone know if there is a way to get Java (or Eclipse) to ignore the JAVA_TOOL_OPTIONS variable ... or possibly replace the agentlib value with one that doesn't cause interference? – David G Aug 11 '11 at 17:52
  • 1
    @david: you could try and define them to "" in the [`eclipse.ini`](http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse/3275659#3275659), as vm argument (`-DJAVA_TOOL_OPTIONS=""`) – VonC Aug 11 '11 at 17:56
  • @VonC that doesn't appear to work ... if I put a -agentlib parm directly under the -vmargs line, the agent is invoked ... if I put the same line in -DJAVA_TOOL_OPTIONS="..." ... the agent is not invoked. I'm testing with the hprof agent. IIRC, the -D parameter sets SYSTEM properties, not environment variables. – David G Aug 11 '11 at 18:32
  • @david: "-D parameter sets SYSTEM properties, not environment variables": correct. – VonC Aug 11 '11 at 19:23
4

Check the JAVA_TOOL _OPTIONS variable. It probably has a value of "-agentlib:jvmhook". Clear the variable and Eclipse based products should start working.

You'll probably need to update your HP QT launcher to set this variable when you want to do profiling.

Donald
  • 41
  • 1
  • 1
    I had previously renamed the `_JAVA_TOOL_OPTIONS` variable because it was conflicting with the Java runtime that was running when I started the Weblogic installer. Re-naming (back to `_JAVA_TOOL_OPTIONS` helped me. – Alex Aug 11 '11 at 14:21
2

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.

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

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 .

enter image description here

2

QTP installation mess up with classpath of many applications.

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.

Nash
  • 21
  • 1
1

create a batch file clearing the variables and run the 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
Ramesh
  • 11
  • 1
1

I had the same error. So, I found next solution :

  1. Go to folder with eclipse.exe. and open configuration file

    enter image description here

  2. After that delete line "-vmargs" and add Your path to JDK (In my occasion is C:\Program Files\Java\jdk1.7.0_79\bin)

    enter image description here

    1. Now Your eclipse should start normally.
Roman Soviak
  • 791
  • 2
  • 9
  • 30
0

I think that the problem could be that the mercury "bundle" is somehow referenced but not in the classpath.

ATorras
  • 4,073
  • 2
  • 32
  • 39
0

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.

0

If Eclipse is not running for example when you double click on the eclipse.exe, then Eclipse appears for few seconds and disappears:

  1. Go to Environment Variables
  2. Clear the Java Options and IBM.
  3. Try to open the Eclipse.
demongolem
  • 9,474
  • 36
  • 90
  • 105
0

Check if virtual machine is running properly or not. If not uninstall and re-install jdk.

0

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.

Quest
  • 1
0

For me, removing -agentlib:jvmhook from JAVA_TOOL_OPTIONS worked.

Obaid
  • 75
  • 2
  • 9