解決tomcat運行時黑窗口一閃而過的方法

很多小夥伴運行tomcat的時候黑窗口會一閃而過,那麼到底是哪裏出問題了呢?而且大多數人都是沒有頭緒的,這個時候就打開tomcat的目錄,進入bin目錄,打開startup.bat文件(不是雙擊打開,是右鍵用記事本打開)
在這裏插入圖片描述

打開文件以後,修改兩個地方:

①:把倒數第二句的start換成run
②:在最後面加入pause,這個單詞是防止黑窗口自動關閉的,黑窗口開啓遇到意外就會停止

在這裏插入圖片描述

修改好以後保存

然後雙擊startup.bat運行,這個時候黑窗口會暫停下來,題主出現的就是下面這個問題。

-Djava.endorsed.dirs=D:\JAVA\apache-tomcat-solr\\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.
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.

題主暫停以後發現是這一句有問題,這是JDK版本過高出的問題,所以題主在環境變量裏面把1.9(有的人稱爲9.0)的目錄換成了1.8的目錄,然後再次運行,於是運行成功~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章