What am I doing wrong here:
class Helo {
public static void main (String[] args) {
System.out.println ("Hello, world.");
System.out.println ("How are you?");
}
}
When I enter the terminal, I do:
cd ~
javac Atempt2.java (//that the file name)
java Atempt2
and then he gives me this error message:
Exception in thread "main" java.lang.NoClassDefFoundError: Atempt2
So, all this is what I do and what happens:
david-allenders-macbook-pro:~ davidallender$ cd ~
david-allenders-macbook-pro:~ davidallender$ javac Atempt2.java
david-allenders-macbook-pro:~ davidallender$ java Atempt2
Exception in thread "main" java.lang.NoClassDefFoundError: Atempt2
david-allenders-macbook-pro:~ davidallender$
I am very new to this, so please explain things very simply.
Thank.
source
share