JRuby

Special classloader when run from command line

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 0.9.1
  • Fix Version/s: JRuby 0.9.8
  • Component/s: Java Integration
  • Labels:
    None
  • Number of attachments :
    0

Description

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

Activity

Hide
Charles Oliver Nutter added a comment -

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
Show
Charles Oliver Nutter added a comment - 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
Hide
Nick Sieger added a comment -

See also JRUBY-288, another classloader issue to keep in mind while working on this one.

Show
Nick Sieger added a comment - See also JRUBY-288, another classloader issue to keep in mind while working on this one.
Hide
Charles Oliver Nutter added a comment -

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.

Show
Charles Oliver Nutter added a comment - 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.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: