简体   繁体   中英

Add a Build Path to Eclipse Plugin

I need to add a variable to a jar in my Eclipse plugin project. I get a "No class definition found" exception. My thought is that I need to add it somehow in the manifest file?

The best way to do this (if it will work for you) is to include the jar in the bundle (plugin) from which you want to use it. This allows you to use the functionality in the jar, but not expose it to the rest of your application except through whatever API you provide for your plugin. You can add the jar to your plugin's classpath, which allows you to access all of its classes

It's best if you completely hide the external jar by not exposing its internal packages from the manifest file, and by not exposing any of its classes to the rest of the application, though if you need to do so, it is possible. I have done this both ways and prefer to hide the external jars. The Eclipse RCP book (McAffer and Lemieux) covers this process in some detail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM