Skip to content

various issues launching script from runnable jar #2948

@mkristian

Description

@mkristian

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions