Answers for "how to run a java class from command line"

1

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
0

java run class file

java -cp ./ {NAME}
Posted by: Guest on August-26-2020
1

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
-1

run java in cmd

C:\Users\Your Name>javac MyClass.java
Posted by: Guest on June-20-2021
0

java run class file

java -cp ./ {NAME}
Posted by: Guest on August-26-2020
-1

run java in cmd

C:\Users\Your Name>javac MyClass.java
Posted by: Guest on June-20-2021

Code answers related to "how to run a java class from command line"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language