Hello,
I am creating a .jar that will compile and run java programs through terminal. I have gotten the command to compile the java file that filePath refers to, but cannot figure out how to pass commands or text to an open Terminal.app window.
I am using a mac.
How I got my terminal window to open is by doing this:
How do I pass code to the open window.public static void main(String[] args) { Desktop d = Desktop.getDesktop(); File f = new File("/Applications/Utilities/Terminal.app"); try { d.open(f); } catch (IOException e) { e.printStackTrace(); } }
I have tried using process builders and runtime execs but none of those would open the terminal window. I need the window open in case the user's .class file uses System.out and System.in commands so that they can interact with it.