I have an executable jar that loads jruby. An installer drops the jar and some pre-packaged jar libraries (including complete jruby and some gems) into the install location.
Everything works fine except in Windows when the jar is installed into a folder with spaces in the name . Jruby fails when it encounters a simple "require" from one of the jar-packaged gems ("require singleton" in the statemachine gem if that matters).
This would have not been much of a problem but i need the jar to run from under program files. Hoping that someone out there has solved this :)
Stack trace:
> Java::OrgJrubyExceptions::RaiseException - no such file to load --
> singleton file:/C:/<install
> location>/lib/java/state_machine-0.9.4.jar!/state_machine/matcher.rb:1:
> in `require': no such file to load -- singleton (LoadError)
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> matcher.rb:1
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> matcher.rb:1:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/ guard.rb:1
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> guard.rb:2:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/ event.rb:2
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> event.rb:6:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> machine.rb:6
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> machine.rb:1:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine. rb:1
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine. rb:1:in
> `require'
> from src/application.rb:1:in `require'
> from src/main.rb:54:in `require'
> from <script>:1
> ...internal jruby stack elided...
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!
> /state_machine/matcher.rb:1)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4
> .jar!/state_machine/matcher.rb:1)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar! /state_machine/guard.rb:1)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4 .jar!/state_machine/guard.rb:2)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar! /state_machine/event.rb:2)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4 .jar!/state_machine/event.rb:6)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!
> /state_machine/machine.rb:6)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4
> .jar!/state_machine/machine.rb:1)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar! /state_machine.rb:1)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4 .jar!/state_machine.rb:1)
> from Kernel.require(src/application.rb:1)
> from Kernel.require(src/main.rb:54)
> from Kernel.require(<script>:1)
> from (unknown).(unknown)(:1)
It's probably a bug. What software did you use to create the executable jar? What version of JRuby? We've dealt with filenames-with-spaces bugs in the past, but there certainly could be others. Can you file a bug at http://bugs.jruby.org? Thanks.