I have some Java (swing) code that makes a call to Runtime.getRuntime().exec()
. The program runs perfectly well if I run it from the command line.
The problem is, when I'm not running from command line, the application isn't making the call to Runtime.getRuntime().exec()
, so I can't execute the system commands that I want. When I double click the jar file, the GUI pops up, and everything works perfectly, except for the system call.
Here is a similar thread about a program outputting to console after double-clicking an executable jar, but it isn't quite what I'm looking for: Double Clicking JAR file does not open Command Prompt
Any ideas on how to get this to work? Any help is greatly appreciated!
I'm running Ubuntu on a VM, and I also eventually want to port this to Mac OS.