您的位置:首页 > 运维架构 > Tomcat

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

2017-03-17 17:07 197 查看
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成功
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐