FS#24126 - Tomcat Don't start using Oracle JRE
Attached to Project:
Arch Linux
Opened by Leandro Costa (lokidarkeden) - Friday, 06 May 2011, 12:49 GMT
Last edited by Andrea Scarpino (BaSh) - Tuesday, 24 May 2011, 06:00 GMT
Opened by Leandro Costa (lokidarkeden) - Friday, 06 May 2011, 12:49 GMT
Last edited by Andrea Scarpino (BaSh) - Tuesday, 24 May 2011, 06:00 GMT
|
Details
Description: The package tomcat don't start using the oracle
jre/jdk saying "Cannot locate Java Home".
Additional info: tomcat 5.5.33-1 Steps to reproduce: Install oracle jre and tomcat: pacman -S jre tomcat Start the tomcat: /etc/rc.d/tomcat start Proposed Solution: Change the /etc/conf.d/tomcat to point to the right java_home place: # The JAVA_HOME of the JVM for Tomcat to use if [ -x /usr/lib/jvm/java-6-openjdk ]; then TOMCAT_JAVA_HOME=/usr/lib/jvm/java-6-openjdk elif [ -x /opt/java/ ]; then TOMCAT_JAVA_HOME=/opt/java/ fi # Tomcat additional commandline options CATALINA_OPTS= |
This task depends upon
Closed by Andrea Scarpino (BaSh)
Tuesday, 24 May 2011, 06:00 GMT
Reason for closing: Not a bug
Additional comments about closing: By default it works with OpenJDK, you have to edit the config file to let it work with Oracle Java
Tuesday, 24 May 2011, 06:00 GMT
Reason for closing: Not a bug
Additional comments about closing: By default it works with OpenJDK, you have to edit the config file to let it work with Oracle Java
something like:
pacman -S jre
pacman -S tomcat
reboot
after the reboot
su
/etc/rc.d/tomcat start
:: Starting Tomcat [BUSY] Cannot locate Java Home
[FAIL]
Same Error.
It works after the alterations I proposed.
The solution you propose would not be great if both openjdk6 and jre were installed! Then it would use the first case of your "if" and would ALWAYS go for openjdk.
Só I thaught tomcat should be able to start with it.
In any case, the point about to choose a jvm would envolve to create a file to set the variables JVM and JVM_CUSTOM_FOLDER, for example:
. /etc/conf.d/jvm
case "$JVM" in
OPENJDK)
TOMCAT_JAVA_HOME=/usr/lib/jvm/java-6-openjdk
;;
JRE)
TOMCAT_JAVA_HOME=/opt/java
;;
CUSTOM)
TOMCAT_JAVA_HOME=$JVM_CUSTOM_FOLDER
;;
# CHECKING_JAVA_HOME
if [ ! -x $TOMCAT_JAVA_HOME ]; then
echo "FAILED TO LOOKUP THE JAVA HOME";
return 1;
fi
IMHO, this is too much complicate and it's out of the arch way, but it should work with jre since it's in the official repo. :)
Thanks for your attention
I am not saying jre is not "official"
> Só I thaught tomcat should be able to start with it.
It is! You just need to change the path in /etc/conf.d/tomcat. It is just not automatically done just like in a config file.
> In any case, the point about to choose a jvm would envolve to create a file to set the variables JVM [...] for example /etc/conf.d/jvm
Good idea but I would do it differently: each "java-runtime"-able package (jre, openjdk6) could have a /etc/conf.d/${pkgname} but NO /etc/profile.d and the user could specify what he/she wants through /etc/profile.d/jvm which would point to the conf.d he/she likes.
But that is not a tomcat bug/improvement ;). You might want to change your bug report to target openjdk6.
pacman -S tomcat
resolving dependencies...
:: There are 2 providers available for java-environment:
:: Repository extra
1) openjdk6
:: Repository community
2) jdk
Enter a number (default=1): 2
looking for inter-conflicts..
So, as I said before, everybody hopes it work with jdk :)
thanks for your attention.
It does.
What you are asking me to do is to add *code* in a *config* file: /etc/conf.d/tomcat. This is a config file as you can see on the dir name "conf.d". That would be like adding code to the rc.conf. There is no code in these files, just variables set to *default* values. You - the power user - are able and expected to tune these values to fit your needs and desires. The value TOMCAT_JAVA_HOME in /etc/conf.d/tomcat is set to /usr/lib/jvm/java-6-openjdk because the *default* JVM in Arch Linux is the OpenJDK (because this is the most widely used open JDK out there). But once again this is just a default.
Now I understand your last point "when I try to install the tomcat, withot having a java-runtime installed, I get [to choose a JDK but it does not work out of the box]". As I have said before this could be fixed using a conf file for java-runtimes. It just so happens I am working on something related to openjdk so I will try to implement this.
I understand your point, but I was trying to say just: it's pretty when you say pacman -S somestuff and it works at all.
I know I can just change that line, but, I was cool if it just works with the lot of java runtime we have ( two :).
So I'm leaving this post.
Any way, thank you for your attention and time for aswering me.