i'm trying create java application starts new terminal without using java -jar. tried using several methods, none of them have worked.
i need work on osx, able make on windwos
you have call shell program
runtime runtime = runtime.getruntime(); string[] args = { "/bin/sh", "-c", " java -jar myjar.jar" }; final process process = runtime.exec(args);
to respond specific request, answer
1/ create shell script
for example call loadjava.sh:
#!/bin/sh java -jar path/to/jar/file.jar
2/ call shell script java code open terminal , run shell script
correct code osx is
runtime.getruntime().exec("/usr/bin/open -a terminal /path/to/the/script");
Comments
Post a Comment