aspose file tools*
The moose likes Tomcat and the fly likes Tomcat and JAVA_HOME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat and JAVA_HOME" Watch "Tomcat and JAVA_HOME" New topic
Author

Tomcat and JAVA_HOME

Suhas Wadadekar
Ranch Hand

Joined: May 16, 2006
Posts: 95
Hi,

I was setting up Tomcat on my machine. When I ran startup.bat, it complained about JRE_HOME or JAVA_HOME not set.
So, I set JRE_HOME to a JRE folder. DIDNT WORK
Next, removed JRE_HOME environment variable and added JAVA_HOME and set it's value to the JDK folder. WORKED
Now, I run startup.bat and here's what I see in the cmd window
Using CATALINA_BASE: C:\Apache Tomcat
Using CATALINA_HOME: C:\Apache Tomcat
Using CATALINA_TMPDIR: C:\Apache Tomcat\temp
Using JRE_HOME: C:\Java\jdk1.6.0_04

Really?? I thought I REMOVED JRE_HOME variable and added JAVA_HOME variable that made it work. Why does it say Using JRE_HOME?

Any help appreciated.

Thanks,
Suhas.
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Suhas, check catalina.bat for explanation


rem JRE_HOME Must point at your Java Runtime installation. Defaults to JAVA_HOME if empty
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

Although there's rumor that this is changing, currently you are required to set JAVA_HOME to point to a JDK, not a JRE. If I'm not mistaken, that's because it needs the "javac" program to compile JSPs. So if it's actually saying "JRE" in the console messages, technically it's inaccurate. I haven't been noticing myself.


Customer surveys are for companies who didn't pay proper attention to begin with.
Suhas Wadadekar
Ranch Hand

Joined: May 16, 2006
Posts: 95
Thanks Misha, Tim.

I found the line in catalina.bat that you mentioned.
I also found this in catalina.bat


Shouldn't it echo Using JAVA_HOME instead of Using JRE_HOME, if JRE_HOME was not set or empty?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

This is what catalina.sh says:


Suhas Wadadekar
Ranch Hand

Joined: May 16, 2006
Posts: 95
Ok. Thanks Tim. I am trying to produce Using JAVA_HOME message. I'll give it a try
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat and JAVA_HOME