aspose file tools*
The moose likes Servlets and the fly likes problem setting up environment variable JAVA_HOME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem setting up environment variable JAVA_HOME" Watch "problem setting up environment variable JAVA_HOME" New topic
Author

problem setting up environment variable JAVA_HOME

rajasekhar yakkali
Greenhorn

Joined: Sep 21, 2001
Posts: 2
I am a new user of tomcat. I have seen in the documentation that JAVA_HOME variable has to be setup to the jdk folder.
at the c prompt,I am using set JAVA_HOME = c:\java\jdk1.3.1_01
after doing this ,when i try to start tomcat,It gives me the error:
You must set JAVA_HOME to point at your Java Development Kit installation

Please help me in setting up tomcat so that i can run my servlets.
Thanks,
raj
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
You need to set JAVA_HOME for your entire system, not just the one MSDOS prompt window since Tomcat starts another window.
If you are using Tomcat 3 you need to set TOMCAT_HOME also, if Tomcat 4 it needs CATALINA_HOME. (They did it that way so you could have both 3 and 4 on the same system.)
Bill
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
add to autoexec.bat
set JAVA_HOME = c:\java\jdk1.3.1_01


Senior software engineer
Dave Soto
Ranch Hand

Joined: Sep 15, 2001
Posts: 55
You can also set environment variables in Windows by right-clicking on "My Computer", and in one of the tabs (Depending on which version of windows you run) there is an "Environment variables" section where you can see and edit all your environment variables.
rajasekhar yakkali
Greenhorn

Joined: Sep 21, 2001
Posts: 2
hi guys,
thank you very much.. I am able to make tomcat start now.
but the tomcat is not starting from the command prompt. I am able to run it only from the bin folder and invoking the startup file.
I entered the variables JAVA_HOME and CATALINA_HOME from settings--->control panel-->System---->Advanced--->Environmental variables.
Even though I can work like this,Just for curiosity,why am i not able to invoke tomcat from command prompt?
Please if you know it,let me know.
Thanks,
raj
Sam Dalton
Author
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
The reason that you can not run this from the command prompt is because you are typing
set JAVA_HOME = c:\java\jdk1.3.1_01
Note the extra space after the JAVA_HOME. this does not create a variable called JAVA_HOME, instead it creates a variable called JAVA_HOME<space> where <space> is one character of whitespace. Try typing
set JAVA_HOME=c:\java\jdk1.3.1_01
Now run Tomcat, it will work fine.

<a href="http://www.samjdalton.com" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of [http://www.amazon.com/exec/obidos/tg/detail/-/1590592255/qid=1068633302//ref=sr_8_xs_ap_i0_xgl14/104-4904002-9274339?v=glance&s=books&n=507846]Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/1861007701/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/186100561X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>
 
wood burning stoves
 
subject: problem setting up environment variable JAVA_HOME