jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-196

dynamically adding urls to classpath

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 0.9.8
  • Component/s: None
  • Labels:
    None

Description

It should be possible to add jars / any urls to the search path (classpath) that JRuby uses when resolving include_class. This would make it possible to write scripts that configure their own search path, making calling them much easier as setting up the CLASSPATH is tedious when a lot of jars are involved. Setting up the search path for ruby code is already possible (the variable $, so adding stuff to java classpath should be possible, too.

This should be pretty easy to implement using a subclass of java.net.URLClassLoader.

Something like this, maybe:

require 'java'
Java.classpath << URL.new('foo.jar') # at least a string, a java.net.URL, java.io.File and Ruby File should be acceptable params

Issue Links

duplicates

New Feature - A new feature of the product, which has yet to be developed. JRUBY-618 We should have a $CLASSPATH variable

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Johannes Rudolph added a comment - 16/Oct/06 5:10 AM

There is already a addToClasspath in org.jruby.javasupport.JavaSupport which serves this purpose. You would only have to put it into a Ruby package.

Show
Johannes Rudolph added a comment - 16/Oct/06 5:10 AM There is already a addToClasspath in org.jruby.javasupport.JavaSupport which serves this purpose. You would only have to put it into a Ruby package.
Hide
Permalink
Charles Oliver Nutter added a comment - 03/Apr/07 9:49 PM

We have had a URLClassLoader for some time, and it is being used to load jars dynamically at runtime for JRuby extension gems.

Show
Charles Oliver Nutter added a comment - 03/Apr/07 9:49 PM We have had a URLClassLoader for some time, and it is being used to load jars dynamically at runtime for JRuby extension gems.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Antti Karanta
Vote (0)
Watch (1)

Dates

  • Created:
    11/Oct/06 1:31 AM
    Updated:
    30/Apr/07 3:12 AM
    Resolved:
    03/Apr/07 9:49 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.