Reputation: 565
When I am trying to run tomcat using startup.bat
I get the following error,
The JRE_HOME environment variable is not defined correctly
This environment variable is needed to run this program
I have even tried setting JRE_HOME manually to system variable list, but this issue remains.
My JRE_HOME C:\Program Files\Java\jre1.8.0_121;
What can I do to solve it?
I am using Windows 8
Upvotes: 3
Views: 32191
Reputation: 101
I was facing the same issue.
Firstly in your question it seems that the JRE_HOME
is having \bin
. This is not required.
Still you might get this error. So here is what I found to resolve this issue-
In the running.txt
document that come with the Apache Tomcat says that it is better if the JRE_HOME
is defined in setenv.bat
file. This file does not exist on its own so you need to create it. The file has to be in %CATALINA_BASE%\bin\setenv.bat
path and the content should be
set "JRE_HOME=C:\Java\jre8"
exit /b 0
JRE_HOME
should be the path where your JRE exist.
Now you can start the server.
Upvotes: 10
Reputation: 362
Hope you know the way of setting path in Windows 8. //C:\Program Files\Java\jre1.8.0_121 surely as there is space between Program and Files, these kind of errors are possible. Please correct this path or store this in a path where no space is involved. In Path add JRE_HOME path and click ok Reopen Command prompt window, then again give startup.bat
Hope this helps
Upvotes: 6