Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 JRuby 和 Warbler 构建一个应用程序来打包它。我的问题是我想获取当前运行的jar文件的路径,不写java...
RbConfig::CONFIG["bindir"]有你想要的吗?
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"