java ClassNotFoundException for org.h2.Driver

前端 未结 13 2381
被撕碎了的回忆
被撕碎了的回忆 2021-01-01 10:40

I am trying to use H2 to connect to a database in Java (using Eclipse as the IDE). The sample does (below) throws a ClassNotFoundException. The thing is, I

13条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 11:14

    Using test should not work logically. try it with runtime or provided, unless you need it only for testing phase.

    On maven docs, it says that test dependency is not required for normal use of the application, and is only available for the test compilation and execution phases
    https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

提交回复
热议问题