简体   繁体   中英

Unable to run java with command line arguments

I have been trying to run Java with command line arguments, but for some reason the class can not be found. I am very certain the directory is correct. Is there any way to fix this?

CLDemo.java file

public class Demo {
    public static void main(String[] args) {
        System.out.print("It works!!!");
    }
}

You need to do cd out\\production before java CLDemo .

The default compile output of IntelliJ IDEA is under out\\production folder, and Java needs to run at the corresponding package (folder) of your compile output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM