Hi, I'm fairly new to problem, and I've instantly come across the problem which appears that every newbie seems to come across.
I'm working off a book, on to which a very simple system.out.println code was given out (below):
Code:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
The .java file compiles without any errors at all and a HelloWorld.class file is created. However, whenever I type in either:
Code:
java C:\MYLOCATION\HelloWorld
OR
Code:
java -cp . C:\MYLOCATION\Helloworld
I get the same error:
"Error: Could not find or load the main class HelloWorld"
The class runs fine on Eclipse, but I'd like to know how to do it correctly without the use of an IDE.
Thanks,
James