문제

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...

도움이 되었습니까?

해결책

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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top