File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat and JAVA_HOME

 
Suhas Wadadekar
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 470
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17621
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Suhas Wadadekar
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17621
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what catalina.sh says:


 
Suhas Wadadekar
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Thanks Tim. I am trying to produce Using JAVA_HOME message. I'll give it a try
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic