This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat " Watch "Tomcat " New topic
Author

Tomcat

Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
Hello everyone!

I'm trying to install Tomcat manually. I've done the following to try to set the environment variables but still getting a message that they are not set.

cd c:\
PATH="C:\Program Files\Java\jdk1.6.0_10\bin";%PATH%
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10
set CLASSPATH=.;C:\apache-tomcat-6.0.16\lib\servlet-api.jar;C:\apache-tomcat-6.0.16\lib\jsp-api.jar;C:\apache-tomcat-6.0.16\lib\el-api.jar;C:\Servlets+JSP;..;..\..
pause

I appreciate it
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
You probably want to have them set permanently vs doing it manually every time. What OS do you have?
On XP go to Settings|Control Panel|System|Advance|Environment Variables and enter a CLASSPATH, etc entry or add to the existing one.
[ July 03, 2008: Message edited by: Norm Radder ]
Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
Vista.

But shouldn't it work regardless?
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
It should work if you are starting tomcat from the same command prompt (or script) where you have those set commands you listed. If is done in some other command prompt or through double clicking the icon for example then you might run into problems.
Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
I have a .bat file with the following:

cd c:\
PATH="C:\Program Files\Java\jdk1.6.0_10\bin";%PATH%
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10
set CLASSPATH=.;C:\apache-tomcat-6.0.16\lib\servlet-api.jar;C:\apache-tomcat-6.0.16\lib\jsp-api.jar;C:\apache-tomcat-6.0.16\lib\el-api.jar;C:\Servlets+JSP;..;..\..
cd apache-tomcat-6.0.16/bin
startup.bat
pause

It doesn't work. It doesn't pause either.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
What is the error message you receive?
And it does not pause because the startup.bat probably calls exit or the like in the end and so the pause command is never reached.
Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
I went into the "setclasspath.bat" file and put in the location of the jdk.
However, when i try to start Tomcat, I get "Neither the JAVA_HOME..." (see below: this is a snippet of setclasspath.bat)

rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "C:\Program Files\Java\jdk1.6.0_05" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 198
I'm confused. This line
if not "%JAVA_HOME%" == "C:\Program Files\Java\jdk1.6.0_05" goto gotJdkHome

checks that JAVA_HOME is "C:\Program Files\Java\jdk1.6.0_05" and if it is returns false. Why is that? The original file (the unchanged one) looks like this
rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit

and it works fine on my computer... Just tested.
Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
got it! Thanks for helping me work through this! This site Rocks!!!
 
jQuery in Action, 2nd edition
 
subject: Tomcat
 
Similar Threads
Classpath setting involving java and javac
package javax.servlet does not exist
Unable to import
Compilation problem in servlets
Configuration problem