Skip to content
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
Closed

various issues launching script from runnable jar #2948

mkristian opened this issue May 15, 2015 · 0 comments

Comments

@mkristian
Copy link
Member

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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants