I am trying to put some java files into a package however it is causing
me problems.
I have 4 JAVA Files called Node, Tree, Coalesce and Utilities. When I
put them into a package (called webb.tree) and compile them, they
compile but when I try to run the class with the main function in I get
this error:
Exception in thread "main" java.lang.NoClassDefFoundError: Coalesce
(wrong name:
webb/tree/Coalesce)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
However if i simply remove from each of the 4 files the line "package
webb.tree;" they compile and run fine. What am I doing wrong with the
packages?
Thanks,
Alex