I am trying to run a java file in the cmd prompt in Windows 7.
I get the error:
Error: Could not find or load main class
I actually just save a new simple file to check if there were problems with the package inside eclipse; this new file is saved just as:
C:\Users\User5\Documents\eclipse\test\Example.java
class Example {
// A Java program begins with a call to main().
public static void main(String args[]) {
System.out.println("Test.");
}
}
I changed the classpath
for lucene's jar's recently, and I am not really sure if this is the problem.
There are many other threads about this issue, such as:
Could not find or load main class
but, there seem to be other concerns that solved their issues.
In this case, I have saved just a plain file in notepad, and while I can get the file to compile, and it seems to create the class file, it is still spitting this error back.
This is the dir, which seems to show that the class is there:
C:\Users\User5\Documents\eclipse\test>dir
Volume in drive C has no label.
Volume Serial Number is 3E0D-3B82
Directory of C:\Users\User5\Documents\eclipse\test
12/07/2015 10:15 AM <DIR> .
12/07/2015 10:15 AM <DIR> ..
12/07/2015 10:04 AM 301 .classpath
12/07/2015 10:04 AM 380 .project
12/07/2015 10:04 AM <DIR> .settings
12/07/2015 10:05 AM <DIR> bin
12/07/2015 10:51 AM 428 Example.class
12/07/2015 10:15 AM 162 Example.java
12/07/2015 10:05 AM <DIR> src
4 File(s) 1,271 bytes
5 Dir(s) 10,000,461,824 bytes free
C:\Users\User5\Documents\eclipse\test>java Example.java
Error: Could not find or load main class Example.java