I tried to google this, went to oracle.com and read all the questions on this forum related to this. I wrote a simple "Helloworld" program
package helloworld;
public class Helloworld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
NetBeans compiles the source code into a .class
file. I move that file to C:\MyJava
I try to run it by C:\MyJava> java -cp . Helloworld
and all possible variations of such. I keep getting the NoClassDefFoundError: Helloworld (wrong name: helloworld/Helloworld)
.
To make sure. There's a question almost exactly like this (difference in "wrong name"). The solution to that question does not work in my case.