java Maven Tomcat JAVA_HOME not found in your environment. 错误
2017-07-15 00:42
393 查看
错误提示:
ERROR: JAVA_HOME not found in your environment.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation
在修改环境变量无用的情况下
找到cmd 运行的文件 记事本打开
@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem ---------------------------------------------------------------------------
rem Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings
rem are valid and consistent with the selected start-up options and set up the
rem endorsed directory.
rem ---------------------------------------------------------------------------
添加这两行
set JAVA_HOME=C:\Java\jdk1.8.0_31
set JRE_HOME=C:\Java\jre1.8.0_31
rem Make sure prerequisite environment variables are set
rem In debug mode we need a real JDK (JAVA_HOME)
if ""%1"" == ""debug"" goto needJavaHome
rem Otherwise either JRE or JDK are fine
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is def
91c0
ined
echo At least one of these environment variable is needed to run this program
goto exit
:needJavaHome
rem Check if we have a usable JDK
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
set "JRE_HOME=%JAVA_HOME%"
goto okJava
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly.
echo It is needed to run this program in debug mode.
echo NB: JAVA_HOME should point to a JDK not a JRE.
goto exit
:gotJavaHome
rem No JRE given, use JAVA_HOME as JRE_HOME
set "JRE_HOME=%JAVA_HOME%"
:gotJreHome
rem Check if we have a usable JRE
if not exist "%JRE_HOME%\bin\java.exe" goto noJreHome
if not exist "%JRE_HOME%\bin\javaw.exe" goto noJreHome
goto okJava
:noJreHome
rem Needed at least a JRE
echo The JRE_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto exit
:okJava
rem Don't override the endorsed dir if the user has set it previously
if not "%JAVA_ENDORSED_DIRS%" == "" goto gotEndorseddir
rem Set the default -Djava.endorsed.dirs argument
set "JAVA_ENDORSED_DIRS=%CATALINA_HOME%\endorsed"
:gotEndorseddir
rem Don't override _RUNJAVA if the user has set it previously
if not "%_RUNJAVA%" == "" goto gotRunJava
rem Set standard command for invoking Java.
rem Also note the quoting as JRE_HOME may contain spaces.
set _RUNJAVA="%JRE_HOME%\bin\java.exe"
:gotRunJava
rem Don't override _RUNJDB if the user has set it previously
rem Also note the quoting as JAVA_HOME may contain spaces.
if not "%_RUNJDB%" == "" goto gotRunJdb
set _RUNJDB="%JAVA_HOME%\bin\jdb.exe"
:gotRunJdb
goto end
:exit
exit /b 1
:end
exit /b 0
-------------------------------------------------------------------------------------
Maven Tomcat 出现这个方法通用
就是java 的路径 !!
其他方法不行的同学可以试一下
ERROR: JAVA_HOME not found in your environment.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation
在修改环境变量无用的情况下
找到cmd 运行的文件 记事本打开
@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem ---------------------------------------------------------------------------
rem Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings
rem are valid and consistent with the selected start-up options and set up the
rem endorsed directory.
rem ---------------------------------------------------------------------------
添加这两行
set JAVA_HOME=C:\Java\jdk1.8.0_31
set JRE_HOME=C:\Java\jre1.8.0_31
rem Make sure prerequisite environment variables are set
rem In debug mode we need a real JDK (JAVA_HOME)
if ""%1"" == ""debug"" goto needJavaHome
rem Otherwise either JRE or JDK are fine
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is def
91c0
ined
echo At least one of these environment variable is needed to run this program
goto exit
:needJavaHome
rem Check if we have a usable JDK
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
set "JRE_HOME=%JAVA_HOME%"
goto okJava
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly.
echo It is needed to run this program in debug mode.
echo NB: JAVA_HOME should point to a JDK not a JRE.
goto exit
:gotJavaHome
rem No JRE given, use JAVA_HOME as JRE_HOME
set "JRE_HOME=%JAVA_HOME%"
:gotJreHome
rem Check if we have a usable JRE
if not exist "%JRE_HOME%\bin\java.exe" goto noJreHome
if not exist "%JRE_HOME%\bin\javaw.exe" goto noJreHome
goto okJava
:noJreHome
rem Needed at least a JRE
echo The JRE_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto exit
:okJava
rem Don't override the endorsed dir if the user has set it previously
if not "%JAVA_ENDORSED_DIRS%" == "" goto gotEndorseddir
rem Set the default -Djava.endorsed.dirs argument
set "JAVA_ENDORSED_DIRS=%CATALINA_HOME%\endorsed"
:gotEndorseddir
rem Don't override _RUNJAVA if the user has set it previously
if not "%_RUNJAVA%" == "" goto gotRunJava
rem Set standard command for invoking Java.
rem Also note the quoting as JRE_HOME may contain spaces.
set _RUNJAVA="%JRE_HOME%\bin\java.exe"
:gotRunJava
rem Don't override _RUNJDB if the user has set it previously
rem Also note the quoting as JAVA_HOME may contain spaces.
if not "%_RUNJDB%" == "" goto gotRunJdb
set _RUNJDB="%JAVA_HOME%\bin\jdb.exe"
:gotRunJdb
goto end
:exit
exit /b 1
:end
exit /b 0
-------------------------------------------------------------------------------------
Maven Tomcat 出现这个方法通用
就是java 的路径 !!
其他方法不行的同学可以试一下
相关文章推荐
- 配置 maven 出现的问题Error: JAVA_HOME not found in your environment.
- maven 安装 Error: JAVA_HOME not found in your environment.
- maven 安装报错 Error: JAVA_HOME not found in your environment.(完美解决日志)
- maven 配置报错 JAVA_HOME not found in your environment
- Error: JAVA_HOME not found in your environment. Please set the JAVA_HOME variable in your environmen
- Error: JAVA_HOME not found in your environment. Please set the JAVA_HOME variable in your environmen
- maven 的一些配置和常见错误(The JAVA_HOME environment variable is not defined correctly. This environment vari)
- MavenReportException:The environment variable JAVA_HOME is not correctly set.错误异常解决方法
- The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
- JAVA错误:AXIS Web Service Problem: No compiler found in your classpath! (you may need to add ‘tools.ja
- 双击startup.bat,启动不了tomcat,JAVA_HOME environment variable is not defined correctly
- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java
- The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.p
- The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.p
- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
- 解决 The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
- CentOS hadoop启动错误 JAVA_HOME is not set and could not be found
- 配置完struts,tomcat运行错误java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
- 启动Tomcat错误:he JRE_HOME environment variable is not defined correctly
- 部署程序问题, The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java