I have a program that consists of 3 several classes. Each class begins with this statement:
package com.safeway.co.query;
All classes are in the same directory:
C:\Tomcat 4.1\webapps\meds\WEB-INF\classes\com\safeway\lcham02\query\
javac *.java completes normally.
BUT when I try to execute Main MedQB, I get the following:
C:\Tomcat 4.1\webapps\meds\WEB-INF\classes>
java MedsQB
Exception in
thread "main" java.lang.NoClassDefFoundError: MedsQB (wrong name: com/safeway/lcham02/query/MedsQB)
at java.lang.ClassLoader.defineClass0(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)
I need to have these classes in a named package for my
JSP, but I also want to be able to
test them from the command line.
LC