Currently, I have an Java Standalone Swing Application.
Now, when user clicks on the button in the Swing Application, I would like to launch another Java Application (Say : calculator.jar)
May I know what is the portable way to do so? So that it will work in multiple OS?
Either use Desktop#open()
or just put it in classpath and invoke its main()
.
You should be able to just use java to run the jar.
Runtime.getRuntime().exec("java -jar calc.jar");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With