Originally posted by Peter Laurinec:
Try include "." which points to the actual directory to the classpath.
Usuall call to a class within the package is java package_name.subpackage.ClassName
Advice:
Setting CLASSPATH to contain . or using -cp . will appear to fix all classpath sins, but it really just covers them up. The best approach is to build the jar file and run from it as specified in the project requirements.
To directly answer your question:
if your code is in C:\suncertify\db and you use "package suncertify.db" in main file Test.java, your classpath should be C:\. To run this you would do:
java -cp C:\ suncertify.db.Test
if your classes were in C:\javadev\build\classes\ and you had a mainprogram called URLyBird in package suncertify.gui and you were trying to run from F:\ you would use:
F:\>java -cp c:\javadev\scjd\build\classes suncertify.gui.URLyBird alone
if you packaged all this up in a jar file called runme.jar in the build directory you would use
F:\>java -jar c:\javadev\scjd\build\runme alone
and your manifest file would look like
Manifest-Version: 1.0
Main-Class: suncertify.gui.URLyBird
hope this helps /pkw