我有一个加载jruby的可执行jar。安装程序将jar和一些预先打包的jar库(包括完整的jruby和一些gem)放入安装位置。
除非在Windows中将jar安装到名称中包含空格的文件夹中,否则一切正常。当Jruby从一个罐装宝石中遇到一个简单的“需求”时,Jruby失败了(如果重要的话,在statemachine gem中需要“single singleton”)。
这不是什么大问题,但我需要从程序文件下运行jar。希望有人在那里解决了这个问题:)
堆栈追踪:
> 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)
答案 0 :(得分:0)
这可能是一个错误。你用什么软件来创建可执行jar?什么版本的JRuby?我们过去曾经处理过带有空间错误的文件名,但肯定会有其他错误。你可以在http://bugs.jruby.org提交错误吗?感谢。