Using the BeanShell jars in Eclipse

"Ed Burnette" <[email protected]> Thu, 28 Jul 2005 11:58:22 -0400
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <[email protected]>
I've discovered that if you make a little tweak in your MANIFEST.MF file, then Eclipse (and possibly other OSGi containers like Knoppix) will be able to load it natively. In other words, if you put one of your jar files in an Eclipse plugins directory, Eclipse will treat it as a plug-in and let other plug-ins use it.

In MANIFEST.MF, just add these lines anywhere:

Bundle-ManifestVersion: 2
Bundle-Name: BeanShell Full Library
Bundle-Vendor: BeanShell.org
Bundle-SymbolicName: bsh
Bundle-Version: 2.0.0.b4
Bundle-Localization: plugin
Bundle-ClassPath: .
Export-Package: .,
 bsh,
 bsh.classpath,
 bsh.collection,
 bsh.commands,
 bsh.org.objectweb.asm,
 bsh.reflect,
 bsh.servlet,
 bsh.util
Eclipse-AutoStart: true

These are standard OSGi manifest lines except for that last one. List all packages you want users of the jar to be able to access in the Export-Package list. The Bundle-Version number has to be in OSGi format, which is a 3- or 4- level number (the 4th level can be any string). The Bundle-Name and Bundle-Vendor can be anything you want. There can't be any blank lines or comments in the manifest.

If you could make the additions to your next beta version of BeanShell then that will make it easier for people to use BeanShell in Eclipse.
Thanks,
--Ed
www.eclipsezone.com


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf