Developing with Apache Derby

Having problems getting your successfully compiled Java programs to run? If you are getting the annoying message that "main" was not found in the class, or "class file not found," the following will help you get your CLASSPATH variable sorted out.

This is from Robert Brunner's IBM online tutorial article,
Developing with Apache Derby -- Hitting the Trifecta: Java database development with Apache Derby, Part 3:
If you encounter an error in either using the ij tool or compiling or executing any of the Java classes, the most likely culprit is the Java CLASSPATH environmental variable. Be sure this variable contains the requisite Apache Derby JAR files, which you can do by displaying the value of this variable using the echo $CLASSPATH command; the command should produce output similar to the following (note that your Apache Derby installation may change these values slightly):

/opt/Apache/db-derby-10.2.1.6-bin/lib/derby.jar:/
/opt/Apache/db-derby-10.2.1.6-bin/lib/derbytools.jar:.

(Notice that there is a period after the last colon above. This is not a end of sentence period; it needs to be there so that the current directory is included in the CLASSPATH.

No comments: