javac:包 org.apache.derby.client.am 不存在
我正在尝试编译一个使用 JavaDB/Derby 的 java 程序。在命令行上,我可以运行
java org.apache.derby.tools.sysinfo
而不会出现错误,但是几个文件中的以下行导致我的问题标题中出现错误:
import org.apache.derby.client.am.SqlException;
原因
package org.apache.derby.client.am does not exist
我已经完成了 JavaDB 的全新安装,但我认为这并不重要。我以前编译过这个项目一次,我知道我没有安装 JavaDB。我在项目文件夹的顶层有一个名为 lib 的目录,其中包含 derby 的所有 .jar 文件。而且我很确定我也不必设置任何环境变量。
我该如何修复这个错误?如果我需要提供更多信息,我将很乐意提供。
我使用的是Windows 7和jdk1.7
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您的问题是 JavaDB JAR 不在您的类路径中。确保在
javac
命令上使用-cp
或-classpath
指定它们。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 yourjavac
command.