This is a followup to #4000, the fix for which I believe was incomplete: d4cbfd2 I think the issue below is due to the path starting with classpath:c:/ instead of classpath:/
JRuby 126.96.36.199 complete jar.
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Load files in jar using require_relative.
> java -jar myapp.jar
LoadError: no such file to load -- classpath:C:/lib/test
require at org/jruby/RubyKernel.java:956
require_relative at uri:classloader:/jruby/kernel/kernel.rb:13
<main> at classpath:/jar-bootstrap.rb:1
I happened to have a jruby-complete jar in ~/.jruby-jar/ so I use that below to build the jar on Linux. I'm not sure the Linux part is necessary, but that's where I started.
git clone https://github.com/presidentbeef/jruby-realpath-error.git
cp ~/.jruby-jar/jruby-complete-188.8.131.52.jar myapp.jar
jar ufe myapp.jar org.jruby.JarBootstrapMain jar-bootstrap.rb lib/test.rb
Copy jar to a Windows machine and run it:
java -jar myapp.jar
My fix probably should have just looked for "classpath:".
classpath: URLs are always absolute. Fixes #4188.
I've pushed a fix but I'm not sure the best way to test it. Perhaps you can help us add something under spec/java_integration based on your reproduction?
Please confirm the fix works for you, too.
@headius how can I get a jruby-complete jar for jruby-head?