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?

Apache Tomcat の起動が失敗した原因は環境変数のパスの最後のスラッシュ

Last updated at Posted at 2020-06-12

備忘録
参考:https://dev4app.com/archives/5398654-tomcat-not-starting.html

環境変数のパスの最後のスラッシュが余計だった件。

本日は(昨晩は?) Apache Tomcat9.0.36の64-bit Windows zipをダウンロード。
中身のbinフォルダなどを C:\Apache\apache-tomcat-9.0.36 下に置いたので、
環境変数に

CATALINA_HOME=C:\Apache\apache-tomcat-9.0.36\ 

のようにセットしたのでした。

環境変数を設定して、8080ポートは使っていないのを確認して、binフォルダ下のstartup.batを実行してみたところ、

C:\Apache\apache-tomcat-9.0.36>C:\Apache\apache-tomcat-9.0.36\bin\startup.bat
Using CATALINA_BASE:   "C:\Apache\apache-tomcat-9.0.36"
Using CATALINA_HOME:   "C:\Apache\apache-tomcat-9.0.36"
Using CATALINA_TMPDIR: "C:\Apache\apache-tomcat-9.0.36\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk-14.0.1"
Using CLASSPATH:       "C:\Apache\apache-tomcat-9.0.36\bin\bootstrap.jar;C:\Apache\apache-tomcat-9.0.36\bin\tomcat-juli.jar"

とは表示されるのにどういうわけかtomcatが起動しない。

catalina.bat runを実行して何が起きているのか確認したところ

java.util.logging.ErrorManager: 4: Unable to create [C:\Apache\apache-tomcat-9.0.36" -Dcatalina.home=C:\Apache\apache-tomcat-9.0.36"\logs]
java.util.logging.ErrorManager: 4: Unable to create [C:\Apache\apache-tomcat-9.0.36" -Dcatalina.home=C:\Apache\apache-tomcat-9.0.36"\logs]
java.util.logging.ErrorManager: 4: Unable to create [C:\Apache\apache-tomcat-9.0.36" -Dcatalina.home=C:\Apache\apache-tomcat-9.0.36"\logs]
java.util.logging.ErrorManager: 4: Unable to create [C:\Apache\apache-tomcat-9.0.36" -Dcatalina.home=C:\Apache\apache-tomcat-9.0.36"\logs]
13-Jun-2020 02:40:25.098 驥榊、ァ [main] org.apache.catalina.startup.Bootstrap.initClassLoaders Class loader creation threw exception
        java.lang.IllegalArgumentException: The double quote ["] character can only be used to quote paths. It must not appear in a path. This loader path is not valid: ["C:\Apache\apache-tomcat-9.0.36" -Dcatalina.home=C:\Apache\apache-tomcat-9.0.36"/lib","C:\Apache\apache-tomcat-9.0.36" -Dcatalina.home=C:\Apache\apache-tomcat-9.0.36"/lib/*.jar","C:\Apache\apache-tomcat-9.0.36/lib","C:\Apache\apache-tomcat-9.0.36/lib/*.jar"]

というメッセージが。。。よく見てみると

C:\Apache\apache-tomcat-9.0.36" -Dcatalina.home=C:\Apache\apache-tomcat-9.0.36"\logs

と書いてある。そんなところに「"」があったのですね。CATALINA_HOMEを定義したときの最後のバックスラッシュが悪さをしていたのです。

CATALINA_HOME=C:\Apache\apache-tomcat-9.0.36

と定義しなおしたところ無事tomcatは起動しました。

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?