« 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

No, you still need to use "import" or "include_class" unfortunately.  
This is just shorthand for making them available on the classpath.

/Nick
On Mar 5, 2008, at 9:40 AM, Chris Evans wrote:

> If I require the jars this way, do I also need to include_class the
> classes I need, or will they be available because of the require?
> Because that would be really cool :)
>
> Chris
>
> On Tue, Mar 4, 2008 at 11:31 PM, Nick Sieger <nicksieger@...>  
> wrote:
>>
>> 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
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Dynamically adding to classpath