0

Does another user need the Java Development Kit to execute a Java file with the following code?

try {
   ProcessBuilder pb = new ProcessBuilder("java", "-jar", "ColorPickerFrame.jar");
   ProcessBuilder inheritIO = pb.inheritIO();
   Process p = pb.start();
} catch (IOException ex) {}

Because it contanins the java -jar File.jar statement.

Thanks for your answers.

1 Answer 1

1

No, they simply need any java command on their path. The OS sees this as:

java -jar ColorPickerFrame.jar

and calls any java on the path. In most cases, a JRE will be on the path if not the JDK, so it should work. And you must remember that even via the JDK, a private JRE is used.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.