I'm using NetBeans 6.9.1 on windows and i am following along with a rather simple java tutorial, first it asks me to use notepad but i'd rather just use a IDE for this, anyways i'm asked to create a file and put this code down:
class HelloWorldApp {
public static void main(String[ ] args) {
System.out.println("Hello World!" );
}
}
and i get a lot of compiler errors:
java.lang.NoClassDefFoundError: javaapplication1/Main
Caused by: java.lang.ClassNotFoundException: javaapplication1.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: javaapplication1.Main. Program will exit.
Exception in thread "main" Java Result: 1
i tried to get the wizard to make as clean a starting project as possible, but it seems that nothing is simple here.
so is the code wrong, and the tutorial thus not worth following, or am i doing something wrong with the IDE?