[Bluej-discuss] adding libraries for extensions

Davin McCall davmac at bluej.org
Mon Sep 3 03:10:24 BST 2007


Hi Ben,

Items in the userlib folder aren't accessible to extensions (userlib is 
for making things accessible to programs that you write and run within 
BlueJ, not for extensions). It is possible to use other libraries from 
extensions however; you should put all the necessary jar files in the 
extensions folder, and add a Class-Path attribute to the manifest file 
in your extension which lists those other jar files.

The full jar file spec including manifest entries and formats is here, 
if you need it: http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html

Basically the Class-Path attribute looks something:

    Class-Path: jarfile1.jar jarfile2.jar

Of course you need to replace jarfile1.jar and jarfile2.jar with the 
actual names of the files.

Davin



Ben Kaplan wrote:
> Can user libraries be used with extensions? I'm writing an extension 
> that relies on external libraries. The jars that contain all of the 
> classes I need are in the userlibs folder, and BlueJ says they are 
> loaded. It can find them when I look for it in "Use Library Class", 
> but the extension keeps getting a NoClassDefFoundError when it tries 
> accessing these classes.
>
> ------------------------------------------------------------------------
> Choose the right car based on your needs. Check out Yahoo! Autos new 
> Car Finder tool. 
> <http://us.rd.yahoo.com/evt=48518/*http://autos.yahoo.com/carfinder/;_ylc=X3oDMTE3NWsyMDd2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDY2FyLWZpbmRlcg--%20> 
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mailing list bluej-discuss at bluej.org
> To unsubscribe or change your preferences, go to
> http://lists.bluej.org/mailman/listinfo/bluej-discuss
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20070903/0328b898/attachment.html 


More information about the bluej-discuss mailing list