0

我正在使用 JRuby 和 Warbler 构建一个应用程序来打包它。我的问题是我想获取当前运行的jar文件的路径,不写java...

4

1 回答 1

2

RbConfig::CONFIG["bindir"]有你想要的吗?

$ java -cp Development/src/jruby/lib/jruby-complete.jar org.jruby.Main -e 'require "rbconfig"; p RbConfig::CONFIG["bindir"]'
"file:/Users/asari/Development/src/jruby/lib/jruby-complete.jar!/META-INF/jruby.home/bin"
于 2012-01-05T16:29:06.617 回答