« Return to Thread: Dynamically adding to classpath

Re: Dynamically adding to classpath

by Nick Sieger-2 :: Rate this Message:

Reply to Author | View in Thread

On Mar 4, 2008, at 8:37 PM, Chris Evans wrote:

> I'm working on a module for managing Websphere, using Jruby and
> Websphere MBeans. It works great, but I've modified jruby.sh to add
> the (numerous) needed $WAS_HOME/lib jar files to the classpath.
>
> I'd prefer to give my module the name of the WAS_HOME/lib directory,
> and have my module add the needed jars to the load path or classpath
> programmatically, leaving jruby.sh untouched ( and my command line
> clean and simple)
>
> Possible?

Sure -- try

Dir[ENV['WAS_HOME'] + '/lib/*.jar'].each {|jar| require jar}

-- assuming WAS_HOME is present in the environment.

Cheers,
/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Dynamically adding to classpath