Issue Details (XML | Word | Printable)

Key: JRUBY-262
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Charles Oliver Nutter
Reporter: Brian McCallister
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

Special classloader when run from command line

Created: 16/Nov/06 01:24 PM   Updated: 30/Apr/07 03:12 AM
Component/s: Java Integration
Affects Version/s: JRuby 0.9.1
Fix Version/s: JRuby 0.9.8

Time Tracking:
Not Specified


 Description  « Hide
Consider creating a classloader which allows dynamic adding to the search path for launching from the command line (jirb, etc). The basic use case is being able to pull in java libraries while putzing^w working in jirb without having to restart the session with w new CLASSPATH and build everything up again.

It would be nice to make the classloader a nice public api as well, so that it can be used embedded

See http://kessel.ilrt.bris.ac.uk/jruby/logs/2006-11-16.txt at 9:09:14 for conversation on the topic



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter added a comment - 16/Nov/06 02:04 PM
A couple thoughts on this:
  • require_jar? seems like a good analog to require_gem, but does it imply that something's being bound into Rubyspace? I like the syntax, and I don't think that having it just load a new jar into the current classloader is a problem, since those classes will be accessible through normal Java integration anyway.
  • having something like this would allow including JDBC driver jars in RAILS_ROOT/lib, with appropriate hooks to load them
  • whatever embedding API we finally settle on should also provide a way to specify classloader

Nick Sieger added a comment - 28/Nov/06 02:41 PM
See also JRUBY-288, another classloader issue to keep in mind while working on this one.

Charles Oliver Nutter added a comment - 18/Apr/07 04:08 AM
I believe we actually had this in 0.9.8, where the JRuby classloader is now a URLClassLoader and jars can be loaded at runtime.