How to get the path of the jruby/warbler jar file

2019-08-29 12:33发布

I'm building an application using JRuby and Warbler to package it. My problem is that I want to get the path of the jar file that is currently running, without writing java...

1条回答
老娘就宠你
2楼-- · 2019-08-29 13:27

Does RbConfig::CONFIG["bindir"] have what you want?

$ 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"
查看更多
登录 后发表回答