windows服务器下启动tomcat8-出错Neither the JAVA_HOME nor the JRE_HOMEenvironment variable is defined At lea

D:\tomcat8\bin>startup

Neither the JAVA_HOME nor the JRE_HOMEenvironment variable is defined

At least one of these environment variableis needed to run this program


解决方法:




先看Tomcat的目录bin下startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat。只要在(bin下)setclasspath.bat的开头声明环境变量.

 加上红色的两句就好了(当然了路径 请填写你自己的)注意两个文件

一个是 JAVA_HOME

一个是 JRE_HOME

……......

rem

rem    http://www.apache.org/licenses/LICENSE-2.0

rem

rem Unless required by applicable law oragreed to in writing, software

rem distributed under the License isdistributed on an "AS IS" BASIS,

rem WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied.

rem See the License for the specificlanguage governing permissions and

rem limitations under the License.

 

rem---------------------------------------------------------------------------

rem Set JAVA_HOME or JRE_HOME if notalready set, ensure any provided settings

rem are valid and consistent with theselected start-up options and set up the

rem endorsed directory.

rem---------------------------------------------------------------------------

set JAVA_HOME=D:\Java\jdk1.8

set JRE_HOME=D:\Java\jdk1.8.0_121

 

rem Make sure prerequisite environmentvariables are set

 

rem In debug mode we need a real JDK(JAVA_HOME)

if ""%1"" ==""debug"" goto needJavaHome

……

:end

exit /b 0


最后startup 启动tomcat成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值