How to Run Java code in new terminal Through Java Code in Linux
Hi, Here I have written the snippet for running the java process in new terminal through java code just put your java code name and run simply. import java.io.*; class CodeRunInTerminal { public static void main(String args[]) throws IOException { String command= "/usr/bin/xterm -e java codename";//where the java is command and codename is java code which you want to run in new terminal. Runtime rt = Runtime.getRuntime(); Process pr = rt.exec(command); } } Thanks.