andreas: eclipse + java.lang.NoClassDefFoundError:

Beitrag lesen

hallo zusammen,
ich versuche gerade mal meine rudimentären javakenntnisse nachzuvolltiehen und bin dabei eigentlich schon vorm loslegen gescheitert. dieses banale hello-world beispiel kann ich zwar auf der konsole complilieren und starten, unter eclipse bekommen ich jedoch eine exception. hier erstmal das beispiel, welches unter www/example/Example.java gespeichert ist:

package www.example;

public class Example{

public static void main(String args[])
  {
     System.out.println("Hello World!");
  }
}

habe das ganze mit dem parameter '-verbose:class' getestet; mit paketdefinition bekomme ich diesen fehler:
...
[Loaded java.util.jar.JarEntryjava.lang.NoClassDefFoundError: www/example/Example
from shared objects file]
[Loaded java.util.jar.JarFile$JarFileEntry from shared objects file]
[Loaded java.io.DataInput from shared objects file]
[Loaded java.io.DataInputStream from shared objects file]
[Loaded java.util.zip.ZipFile$ZipFileInputStream from shared objects file]
[Loaded java.util.zip.InflaterInputStream from shared objects file]
[Loaded java.util.zip.ZipFile$2 from shared objects file]
[Loaded java.util.zip.Inflater from shared objects file]
[Loaded java.lang.Math from shared objects file]
[Loaded java.security.PrivilegedActionException from shared objects file]
[Loaded sun.misc.URLClassPath$FileLoader from shared objects file]
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]
Exception in thread "main"

ohne die paketdefinition bekomme ich folgenden fehler:
...
[Loaded java.io.DataInputjava.lang.NoClassDefFoundError: www/example/Example
from shared objects file]
[Loaded java.io.DataInputStream from shared objects file]
[Loaded java.util.zip.ZipFile$ZipFileInputStream from shared objects file]
[Loaded java.util.zip.InflaterInputStream from shared objects file]
[Loaded java.util.zip.ZipFile$2 from shared objects file]
[Loaded java.util.zip.Inflater from shared objects file]
[Loaded java.lang.Math from shared objects file]
[Loaded java.security.PrivilegedActionException from shared objects file]
[Loaded sun.misc.URLClassPath$FileLoader from shared objects file]
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]
Exception in thread "main"

wäre toll, wenn mir jemand bei diesem (sicherlich banalen) fehler helfen kann...

andreas