开发者

Cross-platform jvm launcher?

开发者 https://www.devze.com 2023-03-28 07:54 出处:网络
I\'m lookin开发者_如何学运维g at http://akuma.kohsuke.org/, but it\'s only for POSIX systems. I don\'t need daemonization, just an orderly way to launch more jvms from a java program. Yes, ProcessBuil

I'm lookin开发者_如何学运维g at http://akuma.kohsuke.org/, but it's only for POSIX systems. I don't need daemonization, just an orderly way to launch more jvms from a java program. Yes, ProcessBuilder, but how do I find the right java.exe?


System property java.home contains path to current java home. For example on my computer it is C:\Program Files\Java\jdk1.6.0_21\jre. So, the following statement System.getProperty("java.home") + "/bin/java" should give you the fully qualified path to your current JVM.

If you want to be even more cross platform use File.separator instead of slash.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号