I'm learning Java from the ground up, and I'm hoping someone can help me with an infuriating problem I've encountered. Here's the source code that works after I run "javac Example", and "java Example":
class Example {
public static void main (String args[]){
System.out.println("This is an example class");
}
}
But if I try:
package examples;
class Example {
public static void main (String args[]){
System.out.println("This is an example class");
}
}
...it goes to hell, and I get "Error: Could not find or load main class Example Caused by: java.lang.ClassNotFoundException: Example" returned to me.
I've trawled many resources on the net, which all say the same thing about getting the classpath right (which I've been over many times as of this typing), and none of the solutions work. Please assist if you can. Thanks.