Hello at all,
I hope you will understand my english, to apologize previously I am german
Ok, well, I bought the book Head First
Java (so it is called or?) and try to type my first program.
After many problems with the compiling and the typing with the whole path to javac instead of just javac or %javac (the problem isnt solve anyway!)
I looked here for my problem, and could fix a bug for the compiler.
But my programme still not run...
OS: Windows 7
Filename "ersteanwendung"
Path to Java "C:\Program Files (x86)\Java\jdk1.6.0_20\bin
Path to the files: "C:\javatry"
So, the compiler create the class file, "javatry" contains now ersteanwendung.java and ersteanwendung.class
The contain of ersteanwendung.java:
Now I try to start the file, and get these error message:
C:\Program Files (x86)\Java\jdk1.6_0_20\bin>java "C:\javatry\ersteanwendung" (Here I have to say that I tried also without "")
The error:
Exception in
thread "main" java.lang.NoClassDefFoundError: C:\javatry\ersteanwendung
Caused by: java.lang.ClassNotFoundException: C:\javatry\ersteanwendung
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.secruity.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: C:\javatry\ersteanwendung. Program will exit.
Hope you can help me
Best wishes,
Sascha