简体   繁体   中英

Cross-platform jvm launcher?

I'm looking 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM