It is possible to execute external commands in java at run time.
However, what I am looking for is to actually open cmd or terminal and show that executing external command on screen.
I tried to execute a jar console application as java -jar jartool arguments
, it works both on Windows and Ubuntu. The only problem is that, this does not open cmd or terminal separately. it runs the command in background.
We can use either ProcessBuilder
and the start process or simply Runtime.getRuntime().exec
.
I need to forcefully open the cmd or terminal. Java is configured to show console on windows but still no luck.
Any idea why this is happening or what should I do to force it to open cmd or terminal independent of current cmd or terminal.