Bug 640134 - Issues with setting JAVA_HOME
Summary: Issues with setting JAVA_HOME
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: tomcat6
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Knox
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-04 21:51 UTC by Orion Poplawski
Modified: 2015-11-02 00:15 UTC (History)
7 users (show)

Fixed In Version: tomcat6-6.0.26-27.fc14
Clone Of:
Environment:
Last Closed: 2011-10-20 09:54:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2010-10-04 21:51:18 UTC
Description of problem:

In /etc/tomcat6/tomcat6.conf, JAVA_HOME is set to:

JAVA_HOME="/usr/lib/jvm/java-1.6.0"

But this is only present if the JDK (e.g. java-1.6.0-openjdk-devel) is installed, which is not explicitly requires by tomcat6.  With this setting:

# JAVA_HOME=/usr/lib/jvm/java-1.6.0 build-classpath commons-daemon
/usr/bin/build-classpath: error: JVM_LIBDIR /usr/lib/jvm-exports/java-1.6.0 does not exist or is not a directory

which gets inserted into the classpath:

/usr/bin/java -Xms512m -Xmx1024m -XX:MaxPermSize=256m -classpath :/usr/share/tomcat6/bin/bootstrap.jar:/usr/share/tomcat6/bin/tomcat-juli.jar:/usr/bin/build-classpath: error: JVM_LIBDIR /usr/lib/jvm-exports/java-1.6.0 does not exist or is not a directory -Dcatalina.base=/usr/share/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat6/temp -Djava.util.logging.config.file=/usr/share/tomcat6/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start

If you don't really need the JDK, but want Java 1.6.0, I think you want:

JAVA_HOME=/usr/lib/jvm/jre-1.6.0

Version-Release number of selected component (if applicable):
tomcat6-6.0.26-8.fc14.noarch

Comment 1 David Knox 2010-11-15 17:30:48 UTC
I think it should be '/usr/lib/jvm/java' to comply with alternatives, right?

Comment 2 Orion Poplawski 2010-11-15 17:38:44 UTC
Nope, alternatives provides version specific links in /usr/lib/jvm as well.  We want a 1.6.0 jvm, question is do we need a JDK or a JRE, and I'm arguing you want the latter.

Comment 3 John Dennis 2011-02-28 22:51:44 UTC
I hit the same issue with JAVA_HOME when debugging tomcat6 start up in F15. 

I believe the current setting in /etc/tomcat6/tomcat6.conf is wrong. I think there is a consensus this is wrong.

Now what should it be?

I believe it should be:

/usr/lib/jvm/jre

The reason I believe this is correct value is because you want JRE, not JVM. I think this might have been what Orion in comment #2 was referring to as well. I believe you want JAVA_HOME to be a run time environment (e.g. JRE) and not a SDK (which is what /usr/lib/jvm/java-1.6.0 points to). Also note that SDK link (/usr/lib/jvm/java-1.6.0) is only provided by the -devel package, devel is not a generic runtime environment.

/usr/lib/jvm/jre is a link managed by alternatives to the preferred JRE (preferred java implementation and preferred implementation version). I believe this is what is desired and the intention behind the alternatives configuration.

Any comments on my reasoning?

Comment 4 John Dennis 2011-03-01 20:03:34 UTC
I am not an expert on how we package Java components and how various elements are intended to be used, I can only draw conclusions from limited pieces of information. I'd like to have a Java packaging expert review the suggestion in comment #3. We really want to make sure it's right this time and not iterate making educated guesses. I'm going to try and find someone to review and sanity check my suggestion.

Comment 5 Andrew Overholt 2011-03-01 20:11:11 UTC
/usr/lib/jvm/jre-1.6.0 seems to satisfy both John's and Orion's concerns, no?

Comment 6 John Dennis 2011-03-01 20:25:42 UTC
With respect to comment #2 and comment #5, why should the jre be explicitly versioned?

Comment 7 Jon VanAlten 2011-09-15 22:16:24 UTC
Seems like a valid question to me.  I am not an expert in tomcat or packaging, but I do see that there is not a specific version required in the tomcat6 specfile.  Why then should some specific version be used in config?  Either the spec should require version, or the config should specify the versionless jre directory for JAVA_HOME.  (since comment #2 suggests that 1.6 version is wanted, then I am inclined to suggest that the specfile is what should change here, and I also see that minimum version has been specified in requires for tomcat [7?] package).

Comment 8 Fedora Update System 2011-09-28 15:59:53 UTC
tomcat6-6.0.26-27.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/tomcat6-6.0.26-27.fc14

Comment 9 Fedora Update System 2011-09-29 01:38:27 UTC
Package tomcat6-6.0.26-27.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing tomcat6-6.0.26-27.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/tomcat6-6.0.26-27.fc14
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2011-10-20 09:54:32 UTC
tomcat6-6.0.26-27.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.