New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various issues launching script from runnable jar #2948

Closed
mkristian opened this Issue May 15, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@mkristian
Member

mkristian commented May 15, 2015

the following works:

$ java -jar runnable.jar classpath:bla.rb

these do not work:

$ java -jar runnable.jar classpath:/bla.rb
SyntaxError: Problem reading source: java.io.IOException: Stream closed

or with the uri:classloader:// pseudo protocol

$ java -jar runnable.jar uri:classloader://bla.rb
JRubyFile.java:124:in `createNoUnicodeConversion': java.lang.IllegalArgumentException: Neither current working directory (uri:classloader://) nor pathname (uri:classloader://bla.rb) led to an absolute path
    from JRubyFile.java:59:in `create'
    from RubyInstanceConfig.java:417:in `getScriptSource'
    from Main.java:246:in `internalRun'
    from Main.java:217:in `run'
    from JRubyMain.java:100:in `run'
    from JRubyMain.java:39:in `main'
    from JarMain.java:6:in `main'

or just

$ java -jar runnable.jar bla.rb
Error opening script file: uri:classloader:/bla.rb (No such file or directory)

even though the uri:classloader:/bla.rb is valid resource.

the runnable.jar is the same as from: https://github.com/jruby/jruby/tree/master/maven/jruby/src/it/runnable
just add a 'bla.rb' file to the runnable.jar from there.

@mkristian mkristian self-assigned this May 15, 2015

@mkristian mkristian added this to the JRuby 9.0.0.0.rc1 milestone Jun 2, 2015

mkristian added a commit that referenced this issue Jun 5, 2015

use new JRuby.create to load script from command line script source
delegate script source argument to the new load service FileResource
factory and allow all uri like paths which the regular JRuby code
uses as well.

fixes #2948

Sponsored by Lookout Inc.

Conflicts:
	core/src/main/java/org/jruby/RubyInstanceConfig.java
	core/src/main/java/org/jruby/util/ClasspathResource.java
	core/src/main/java/org/jruby/util/URLResource.java
	core/src/test/java/org/jruby/util/URLResourceTest.java

@mkristian mkristian closed this in 4da7547 Jun 12, 2015

@mkristian mkristian removed the in progress label Jun 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment