LoginSignup
12
15

More than 5 years have passed since last update.

OpenJDK 11へ変更後にApacheTomcat 8が起動しなくなる件の解決方法

Last updated at Posted at 2018-10-15

概要

これまでApacheTomcat 8をOracleJDK 8で動かしていましたが、JDKのバージョンアップの対応によりOpenJDK 11への入れ替えを行いました。すると、ApacheTomcatのログに以下のエラーメッセージが表示されて起動ができなくなりました。エラーを解消するのに苦労したため解決方法を記載しておきます。

[2018-10-16 02:18:51] [info]  ( prunsrv.c:1175) [ 3808] Starting service...
・・・(略)・・・
[2018-10-16 02:18:56] [error] ( javajni.c:763 ) [ 3816] CreateJavaVM Failed
[2018-10-16 02:18:56] [error] ( javajni.c:763 ) [ 3816] 指定されたファイルが見つかりません。
[2018-10-16 02:18:57] [debug] ( javajni.c:1013) [ 3816] Java Worker thread finished : with status = 2
[2018-10-16 02:18:57] [error] ( prunsrv.c:1232) [ 3808] Failed to start Java
[2018-10-16 02:18:57] [error] ( prunsrv.c:1580) [ 3808] ServiceStart returned 4
[2018-10-16 02:18:57] [debug] ( prunsrv.c:885 ) [ 3808] reportServiceStatusE: dwCurrentState = 1, dwWin32ExitCode = 1066, dwWaitHint = 0, dwServiceSpecificExitCode = 4
[2018-10-16 02:18:58] [info]  ( prunsrv.c:1645) [ 3780] Run service finished.
[2018-10-16 02:18:58] [info]  ( prunsrv.c:1814) [ 3780] Commons Daemon procrun finished
<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

解決方法

ApacheTomcatのJVM Optionに java.endorsed.dirs が含まれているとJDK 9以降ではJavaの起動に失敗します。
そのため、含まれている場合はその行の削除が必要です。

-Djava.endorsed.dirs=C:\Program Files\ApacheTomcat\endorsed

Windows環境の場合、以下のレジストリキーからApacheTomcatのJVM Optionの変更ができます。

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\Tomcat8\Parameters\Java\Options

その他、以下の条件に当てはまる場合にもApacheTomcatの起動に失敗するので注意が必要です。

  • JVM Optionに java.ext.dirs が含まれている
  • JVM Optionに Xincgc が含まれている
  • lib/ext ディレクトリが存在する
  • lib/endorsed ディレクトリが存在する

参考: https://docs.oracle.com/javase/jp/9/migrate/toc.htm

12
15
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
12
15