• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Tomcat log shows strange path for java

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

wasnt sure wehter I should post this here or in the tomcat section, but ended up here since it looks like
I am missing something elementary.

I have installed tomcat 5.5 on a linux machine following the standard install instructions.
After having started tomcat using $CATALINA_HOME/bin/startup.sh I get:

Using CATALINA_BASE: /home/mcmurry/tomcat
Using CATALINA_HOME: /home/mcmurry/tomcat
Using CATALINA_TMPDIR: /home/mcmurry/tomcat/temp
Using JRE_HOME: /usr/bin/java
Using CLASSPATH: /home/imcmurry/tomcat/bin/bootstrap.jar

However when I open a browser and point it to http://localhost:8080 I receive the "Could not connect to remote server" message.

Checking catalina.out in the logs folder shows a possible reason: " /usr/bin/java/bin/java: not found"

I have set my $JAVA_HOME to /usr/bin/java and cannot work out why tomcat adds /bin/java to the folder it looks for.
 
Tim McMurry
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could try to create a symlink, but that looks like an ugly hack.
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim McMurry wrote:I have set my $JAVA_HOME to /usr/bin/java and cannot work out why tomcat adds /bin/java to the folder it looks for.



Is /usr/bin/java SDK directory?

Try



 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the TOMCAT_HOME/bin/catalina.sh script to see if anything gets added that shouldn't; maybe print out the paths and variables it assembles at some opportune places.
 
Marshal
Posts: 72088
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question too difficult for "beginning". Moving thread.
 
Saloon Keeper
Posts: 23280
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you're trying to use the built-in java that comes with many current Linux distros. As far as I know, that one still isn't functional enough to run J2EE.

Plus, you need a JDK, not a JRE to run Tomcat.

I recommend downloading and installing one of the Sun JDK's from java.sun.com. If you are running a RedHat/Fedora/CentOS java, you can get it in RPM form. Otherwise just get the version that unpacks into a tarball. I recommend exploding it into a directory named "/usr/java/xxxxx", where "xxxxx" indicates the JDK/JRE version number such as jdk1.6.0_16. That's all the RPM does, but it makes it easy to keep track of (and use) multiple releases of Java.

Set JAVA_HOME=/usr/java/jdk1.6.0_16 - or whatever.

That should make it all work.
 
Tim McMurry
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

thank you for the different detailed suggestions. I changed my $JAVA_HOME to /bin and things work. This is not a nice solution I guess, so I will use your replies to try get things done properly when I have finished my coding assignments for Monday where I need the comcat running
It seems that tomcat adds a /bin/java I didnt except or perhaps I just misunderstand what $JAVA_HOME ought to point to.
 
Tim McMurry
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I should have written that I changed $JAVA_HOME to /usr.
 
Tim Holloway
Saloon Keeper
Posts: 23280
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAVA_HOME points to the root directory of the JDK. I think if you look at the catalina.sh script you'll see that when it starts tomcat it executes "$JAVA_HOME/bin/java", which is where your funny log came from.

If setting JAVA_HOME to /usr "fixed" the problem, you're almost certainly running the open-source gcj java system and not a fully-conformant JDK like the ones that outfits like un and IBM supply. So don't be surprised if your webserver and/or webapp misbehave in strange ways.
 
Tim McMurry
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you mr. Holloway,
I was unaware of the problems with Open JDK. Seems like I will have to use a JDK different from the default one in my linux distro
 
Tim Holloway
Saloon Keeper
Posts: 23280
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:... like the ones that outfits like un and IBM supply. So don't be surprised if your webserver and/or webapp misbehave in strange ways.



That should have been "outfits like [b]Sun[b/] and IBM supply. Some days I can.t type at all!

For a long time, Sun's jdk included proprietary code that prevented it from being open-sourced. A while back they cleaned all that up and the result was the "Iced Tea" effort which, when completed, will permit the punctilious Linux packagers (like Red Hat) to include a 100% compliant JRE/JDK. I'm not sure how far along that effort is, however, so in the mean time, I just keep downloading and installing Sun's. Since Sun is where is all comes from, I also don't have to wait for the latest standard Java technology.
 
Tim McMurry
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:
Some days I can.t type at all!



I was a little surprised for some split-seconds that the United Nations shipped a version of the JDK

But very good to know this. Thanks.
A thread on the openjdk mailing list on this issue:

http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-May/000505.html
 
It means our mission is in jeapordy! Quick, read this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic