Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34123
| From | Duncan Idaho <duncan@dunenoemail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Java 1.8 and CentOS |
| Date | 2016-04-13 15:04 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <neljen$psq$1@dont-email.me> (permalink) |
This is probably off topic but I'm running out of ideas
I have 2 systems
1. Ubuntu Linux 12.10
2. CentOS Linux release 7.2.1511
Each system has the following identical setup
/opt/apache-tomcat-7.0.42
/opt/jdk1.7.0_45
/opt/jdk1.8.0_77
/etc/rc.d/init.d/tomcat7
This script starts tomcat as a unix daemon using jsvc
The script is included at the end of this message FYI
At the start of the script I set the version.
JAVA_HOME=/opt/jdk1.7.0_45
I then type
/etc/rc.d/init.d/tomcat7 start
and tomcat runs like a top on both systems
I then change the script thusly
JAVA_HOME=/opt/jdk1.8.0_77
invoking the script on Ubuntu starts the server
invoking the script on CentOS results in the following error message
Cannot find any VM in Java Home /opt/jdk1.8.0_77
Cannot locate JVM library file
If I set up a systemd service on CentOS and start tomcat under java 1.7
# systemctl start tomcat.service
results in a running server
exactly the same service where the java version is 1.8 fails with the
same message
Cannot find any VM in Java Home /opt/jdk1.8.0_77
Cannot locate JVM library file
I believe this message is coming from jsvc but cannot for the life of
me figure out why this is going wrong.
on CentOS
[root@vps logs]# java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
[root@vps logs]# echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lyallex/.local/bin:/home/lyallex/bin:/opt/jdk1.8.0_77/bin
So the vm is there on the path.
Does anyone have any idea how to fix this as for various reasons I need
to get the server running on CentOS against Java 1.8
thanks
Duncan
==============================/etc/rc.d/init.d/tomcat7
============================
# chkconfig: - 71 19
# description: Start up the Tomcat servlet engine.
# use java 7
# JAVA_HOME=/opt/jdk1.7.0_45
# java 8, works on Ubuntu, fails on CentOS
JAVA_HOME=/opt/jdk1.8.0_77
CATALINA_HOME=/opt/apache-tomcat-7.0.42
export JAVA_HOME CATALINA_HOME
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/commons-daemon.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/bin/tomcat-juli.jar
TOMCAT_USER=tomcat
TMPDIR=/var/tmp
PIDFILE=/var/run/tc7/jsvc.pid
RC=0
case "$1" in
start)
$CATALINA_HOME/bin/jsvc -user $TOMCAT_USER -home $JAVA_HOME
-Dcatalina.home=/opt/apache-tomcat-7.0.42
-Dcatalina.base=$CATALINA_HOME -Djava.io.tmpdir=$TMPDIR
-Djava.awt.headless=true \
-Xms512m \
-Xmx1024m \
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile $CATALINA_HOME/logs/catalina.err \
-pidfile '/var/run/tc7/jsvc.pid' \
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
-Djava.util.logging.config.file=$CATALINA_HOME/conf/logging.properties \
-cp $CLASSPATH \
org.apache.catalina.startup.Bootstrap
RC=$?
[ $RC = 0 ] && touch /var/tc7lock/subsys/tomcat
echo "starting tomcat7 on darkstar with:"
echo "JAVA_HOME=$JAVA_HOME"
echo "CATALINA_HOME=$CATALINA_HOME"
echo "CLASSPATH=$CLASSPATH"
echo "tomcat started"
;;
stop)
PID=`cat /var/run/tc7/jsvc.pid`
kill $PID
RC=$?
[ $RC = 0 ] && rm -f /var/tc7lock/subsys/tomcat /var/run/tc7/jsvc.pid
echo "stopping tomcat7 on darkstar with:"
echo "JAVA_HOME=$JAVA_HOME"
echo "CATALINA_HOME=$CATALINA_HOME"
echo "CLASSPATH=$CLASSPATH"
echo "tomcat stopped"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit $RC
[root@vps logs]#
--
Duncan Idaho
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Java 1.8 and CentOS Duncan Idaho <duncan@dunenoemail.com> - 2016-04-13 15:04 +0100
Re: Java 1.8 and CentOS Nigel Wade <nmw@ion.le.ac.uk> - 2016-04-13 15:42 +0100
Re: Java 1.8 and CentOS Duncan Idaho <duncan@dunenoemail.com> - 2016-04-13 17:33 +0100
Re: Java 1.8 and CentOS Andreas Leitgeb <avl@logic.at> - 2016-04-13 17:29 +0000
Re: Java 1.8 and CentOS Andreas Leitgeb <avl@logic.at> - 2016-04-13 18:14 +0000
Re: Java 1.8 and CentOS Duncan Idaho <duncan@dunenoemail.com> - 2016-04-14 05:18 +0100
Re: Java 1.8 and CentOS Andreas Leitgeb <avl@logic.at> - 2016-04-14 10:44 +0000
Re: Java 1.8 and CentOS Roedy Green <inquiry@mindprod.com> - 2016-07-17 11:56 -0700
csiph-web