0
2

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.

dependencyの追加でエラーがでる

0
Last updated at Posted at 2018-11-16

Eclipse利用中、Mavenプロジェクトにを追加したら、TOMCATが起動しなかった場合。

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0

コンソールログに、上記エラー(Javaの実行環境が古くてMavenが動かない)が出ていたら、実行環境をJava 1.8へ変更する。

  1. プロジェクト→JREシステム・ライブラリーを右クリック→プロパティ
  2. Javaのビルド・パス→ライブラリー→JREシステム・ライブラリーをダブルクリック
  3. 実行環境をJavaSE-1.8へ変更

また、「問題」ログに、「invalid ... header」といったエラーが出てる場合は、
・Eclipseを閉じて、「C:¥Users¥{各ユーザー名}¥.m2¥repository」を削除し、再起動
※再コンパイル時にEclipseが全て再構築してくれる

参照:[maven を使用してライブラリを追加してもエラーが解消されなかった話](maven を使用してライブラリを追加してもエラーが解消されなかった話http://hiisori.jugem.jp/?eid=26)
参照:Java 6 Unsupported major.minor version 51.0

0
2
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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?