I'm trying to run a Java app from the cmd, and I'm getting the following Errors:
Exception in thread "main" java.lang.NoClassDefFoundError: Main
Caused by: java.lang.ClassNotFoundException: Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Main. Program will exit.
In the dir you can find:
Directory of C:\Java
AVLNode.java
AVLTree.java
Comparator.java
HashTable.java
input1.dat
input2.dat
Main.java
StringComparator.java
and I'm Running:
java Main input1.dat input2.dat output1.dat
I have Main.Java in the folder and I have:
public static void main(String[] args)
method on the Main.Java (and some more functions)
I already read the answers about this problem here but I think I did everything alright :( so what can be the problem?