3

我有一个加载 jruby 的可执行 jar。安装程序将 jar 和一些预打包的 jar 库(包括完整的 jruby 和一些 gem)放入安装位置。

一切正常,除了在 Windows 中,当 jar 安装到名称中带有空格的文件夹中时。当 Jruby 遇到来自 jar 打包的 gem 之一的简单“require”(如果重要的话,状态机 gem 中的“require 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)
4

1 回答 1

0

这可能是一个错误。你用什么软件来创建可执行jar?什么版本的 JRuby?我们过去处理过文件名和空格的错误,但肯定还有其他错误。您可以在http://bugs.jruby.org提交错误吗?谢谢。

于 2011-12-09T22:37:06.213 回答