I'm trying to run a command line in a mac terminal using java code (particularly a ProcessBuilder).
I'm coding in a Windows environment and then exporting it to a Mac into a Jar Executable File.
I managed to open the terminal using the code posted below, but once there, the commands are not running, the terminal keeps dead, waiting for a keyboard input.
I will show a simple example for what I want to do:
String[] arguments = new String[] {"/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal", "-c", "pwd"};
Process proc = new ProcessBuilder(arguments).start();
The code seems to run fine until it reaches the "-c" parameter, and then it does nothing else.
Does someone know how to solve this problem? Thanks!
EDIT: I've also tried without the "-c", but same result.