javac:包 org.apache.derby.client.am 不存在

发布于 2024-12-13 07:06:01 字数 522 浏览 7 评论 0原文

我正在尝试编译一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

作业与我同在 2024-12-20 07:06:01

听起来您的问题是 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 your javac command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文