So, I am working on a project that uses inheritance. I have a class Creature, which extends Thing. Also, I have classes Tiger and Ant that extend creature. I also have a TestCreature class. All of these are in the same directory, and they all compile.
However, when I run them all, I get an exception stating:
Exception in thread "main" java.lang.NoClassDefFoundError: Creature/java
Caused by: java.lang.ClassNotFoundException: Creature.java
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
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:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... Can anybody help me fix this? I honestly am not even sure what all that means...
Thanks!!
lrolsto1 0 Newbie Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
sincerelibran -3 Light Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.