1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NoClassDefFoundError、ClassNotFoundExceptionを解決する

Last updated at Posted at 2018-12-05

前提

Eclipseでコンパイル時、クラス関係でエラーが出る。以下は両方とも、ライブラリ(jarファイル)を見つけれていない。

ClassNotFoundException: org.apache.tomcat.dbcp.dbcp2.BasicDataSource

jarファイル場所→tomcat/9/lib/tomcat-dbcp.jar(このパッケージにBasicDataSourceクラスが入っている)

java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory

jarファイル場所→tomcat/9/bin/tomcat-juli.jar

解決策

  1. プロジェクト名を右クリック→プロパティ
  2. Javaのビルド・パス→ライブラリー
  3. 「外部JARの追加」をクリック→該当jarを選択→開く
    2.jpg
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?