问题描述
我正在使用Eclipse EE Kepler而我正试图在我的程序中运行derby。我添加到我的构建路径 derby.jar
和 derbyclient.jar
,但我仍然收到以下错误:
java.lang.ClassNotFoundException:org.apache.derby.jdbc.EmbeddedDriver
。
有人可以帮我解决这个问题吗?
I'm using Eclipse EE Kepler and I'm trying to run derby in my program. I added to my build path derby.jar
and derbyclient.jar
and still I'm getting the following error: java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
.Can someone help me with solving this problem?
推荐答案
我遇到了同样的问题'java.lang.ClassNotFoundException :org.apache.derby.jdbc.EmbeddedDriver'。在我的例子中,scope属性设置为test
I stuck with the same problem 'java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver'. In my case, scope attribute is set to test
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.13.1.1</version>
<scope>test</scope>
</dependency>
您需要从依赖项中删除scope元素并更新依赖项,如下所示。
You need to remove the scope element from the dependency and update the dependency like below.
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.13.1.1</version>
</dependency>
您可以参考,以获得完整的工作示例。
You may refer this post, to get complete working example.
这篇关于java.lang.ClassNotFoundException:org.apache.derby.jdbc.EmbeddedDriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!