Dynamic jar loading in JRuby Netbeans tutorial

Last month I got a feedback email from a developer on my earlier Netbeans tutorials. After successfully packaging JRuby desktop app in a jar, he had a problem with loading class from third party jar files locate outside the package.

The easiest solution was to package the third party jar file at two places: one inside the package for ruby script to access, another outside the jar package for Java class. But that wouldn’t be a good solution. After some thoughts and fiddling around, I came up with ruby script that can dynamically load a class and create class instance from external jar file. This way you only need to include one copy of the third party jar file outside the package.

I’ve created a Netbeans doc tips & tricks for this script, you can check it out here:

Netbeans Tips & Tricks: Dynamic Jar Loading in JRuby 

Teera on March 13th 2008 in Software Development, Ruby, Netbeans, Java

Trackback URI | Comments RSS

Leave a Reply