-3

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!!!");
    }
}
Jonathan Gagne
  • 4,241
  • 5
  • 18
  • 30
Pxartist
  • 5
  • 1
  • 3

1 Answers1

0

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.

Geno Chen
  • 4,916
  • 6
  • 21
  • 39