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.

Comments

Post a Comment

Popular posts from this blog

How to Read Excel File in VC++....

Window could not start the Apache tomcat 6 on Local Computer.For more information, review the System Events Logs.If this is a non-Microsoft service,contact service vendor, and refer to service-specific error code 0.

ORACLE DBA INTERVIEW QUESTION & ANSWERS