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

  1. You’d outstanding guidelines there. I did a search about the field and identified that very likely the majority will agree with your web page.
    Kumaun University BCOM 1st Year Result 2020
    Kumaun University BCOM 2nd Year Result 2020
    Kumaun University BCOM 3rd Year Result 2020

    ReplyDelete

Post a Comment

Popular posts from this blog

How to Bind Multiple SMPP Acounts Using Kannel SMS Gateway.

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