Dependency between Eclipse plug-ins, export jar package installation, error "Java.lang.NoClassDefFoundError"

Source: Internet
Author: User
Tags jboss

In the process of developing plug-in a and plug-in B, Plugin a needs to use a class ClassB to Plugin B, assuming ClassB is located in Plugin b Packageb,

Then you need to add the Manifest.mf file in plugin B:

Export-package:  Packageb

and add in plugin B's MANIFEST.MF file:

Import-package:  Packageb

This declares the dependency relationship.

After exporting the jar packages of two plugins separately, after copying them into Eclipse's/plugin directory, run Eclipse and discover that two plug-ins can function independently, but when Pluga calls CLASSB, the system error:

1 Java.lang.noclassdeffounderror:org/jboss/tools/vpe/browsersim/eclipse/launcher/browsersimlauncher2 At Org.ayound.js.debug.launch.JsLaunchConfigurationDelegate.launch (jslaunchconfigurationdelegate.java:101) 3 At org.eclipse.debug.internal.core.LaunchConfiguration.launch (launchconfiguration.java:858)4 At org.eclipse.debug.internal.core.LaunchConfiguration.launch (launchconfiguration.java:707)5 At org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch (debuguiplugin.java:1018)6 At Org.eclipse.debug.internal.ui.debuguiplugin$8.run (debuguiplugin.java:1222)7 At Org.eclipse.core.internal.jobs.Worker.run (worker.java:53)8 caused by:java.lang.ClassNotFoundException: Org.jboss.tools.vpe.browsersim.eclipse.launcher.BrowserSimLauncher cannot be found by org.ayound.js.debug.core_ 2.2.09 At org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal (bundleloader.java:501)Ten At Org.eclipse.osgi.internal.loader.BundleLoader.findClass (bundleloader.java:421) One At Org.eclipse.osgi.internal.loader.BundleLoader.findClass (bundleloader.java:412) A At Org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass (defaultclassloader.java:107) - At Java.lang.ClassLoader.loadClass (classloader.java:358) -... 6 more

Plugina (in this case, org.ayound.js.debug.core_2.2.0) cannot find the CLASSB of PLUGINB (in this case, Org.jboss.tools.vpe.browsersim.eclipse) ( BROWSERSIMLAUNCHER.CLASS)!!

It took a long time to find a solution: Add the "-clean" option when you start Eclipse .

You can modify the Eclipse.ini file or command line startup, under the Windows platform, you can find Eclipse.exe, right-click Create shortcut, and then right-clicking on the shortcut icon, properties---"... Eclipse.exe "Then add"-clean "and double-click the shortcut to run Eclipse.

Why start with the option "-clean"?

Because this indicates that all dependencies on the plug-in when Eclipse starts are rebuilt instead of using the previous cached content .

Please refer to StackOverflow

Dependency between Eclipse plug-ins, export jar package installation, error "Java.lang.NoClassDefFoundError"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.