This would seem to be the simplest thing but it is bothering me in two ways.
One is that something isn't working properly.
And two is that I can't seem to figure out how to fix it.
The source file comes from the sun.java website as follows:
This compiles with no complaints but when I try to run it I get this:
charles@linux-hoq0:~/javaJunk/HelloWorld> java HelloWorldSwing
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldSwing (wrong name: start/HelloWorldSwing)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
charles@linux-hoq0:~/javaJunk/HelloWorld>
I've looked all over the place (including these forums) for answers and found many different suggestions. None of the suggestions apply in any way I'm aware of. In my book,
Head First Java, swing apps aren't covered until chapter 12 and I'm only on Ch.3 so it's not a panic, but it still bothers me.
I have Java 1.5.0_08 on a 64 bit linux box (Open Suse 10.2)
Any help I could get would be well appreciated.
Thanks