Plugin A uses a class,ClassB, which is from Plugin B.When "run as eclipse application", everything goes well; however, when PluginA adn Plugin B are exported as Jar, and install into a new eclipse platform, they run well independently, but crash when the codes reach the line where Plugin A uses the ClassB.
error log: ava.lang.NoClassDefFoundError Caused by: java.lang.ClassNotFoundException
In plugin org.jboss.vpe.browsersim.eclipse, there is BrowserSimLauncher.java in the package org.jboss.vep.browsersim.eclipse.launcher;
In plugin org.ayound.js.debug.core, there exits a java file "JsLaunchConfigurationDelegate.java", and I put BrowserSimLauncher.launchBrowserSim(startUrl);
into it, this means I've used previous plugin's class 'BrowserSimLauncher' in the latter plugin.
I also do all the"dependencies things", including adding lines to latter plugin's manifest.mf:
Import-Package: org.jboss.tools.vpe.browsersim.eclipse.launcher
and to previous plugin's manifest.mf:
Export-Package: org.jboss.tools.vpe.browsersim.eclipse.launcher
In the development environment, both plugins compiles successfully, when "run as eclipse application", things goes well, and the latter plugin can sucessfully call BrowserSimLauncher.launchBrowserSim(startUrl);
;
however, when I exported both plugins as several .jar files, and copy them into the /plugin folder of another eclipse directory, start the eclipse, both plugins can run well independently, but the plugin fails to call BrowserSimLauncher.launchBrowserSim(startUrl);
. and the error log show as follow:
!ENTRY org.eclipse.core.jobs 4 2 2015-01-06 16:29:03.817
!MESSAGE An internal error occurred during: "Launching index.html".
!STACK 0
java.lang.NoClassDefFoundError: org/jboss/tools/vpe/browsersim/eclipse/launcher/BrowserSimLauncher
at org.ayound.js.debug.launch.JsLaunchConfigurationDelegate.launch(JsLaunchConfigurationDelegate.java:101)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.jboss.tools.vpe.browsersim.eclipse.launcher.BrowserSimLauncher cannot be found by org.ayound.js.debug.core_2.2.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
the latter plugin(js.debug.core) can't find the previous plugin(browsersim.eclipse)!