Search code examples
javajavacderbyjavadb

javac: package org.apache.derby.client.am does not exist


I'm trying to compile a java program that is using JavaDB/Derby. On the command line I can run

java org.apache.derby.tools.sysinfo

without errors, but the following line in several of the files causes the error in my question title:

import org.apache.derby.client.am.SqlException;

causes

package org.apache.derby.client.am does not exist

I've done a fresh installation of JavaDB, but I don't think that matters. I've compiled this project once before, and I KNOW I didn't have JavaDB installed. I just had a directory at the top level of the project folder called lib with all of derby's .jar files inside. And I'm pretty sure I didn't have to set any environment variables either.

How can I fix this error? If I need to provide any more information, I will be happy to do so.

I'm using Windows 7 and jdk1.7


Solution

  • Sounds like you have an issue with the JavaDB JARs not being on your classpath. Make sure you specify them using -cp or -classpath on your javac command.