Reputation: 18159
Was reading this question: Execute .jar file from a Java program and the answer tells you to use a ProcessBuilder
:
ProcessBuilder pb = new ProcessBuilder("/path/to/java", "-jar", "your.jar");
How do I find out the /path/to/java
using code? Of course I could look up java
in my machine, but an end-user may not necessarily have Java installed in the same place as I do...
Upvotes: 0
Views: 55