Answers for "how to run the java fom the command line"

5

java run cmd

public void excCommand(String new_dir){
    Runtime rt = Runtime.getRuntime();
    try {
        rt.exec(new String[]{"cmd.exe","/c","start"});

    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Posted by: Guest on July-05-2021
3

run java from terminal

//Run this line to compile
javac programName.java

//Run this line to run
java programName
Posted by: Guest on March-23-2021

Code answers related to "how to run the java fom the command line"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language