Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Duncan Idaho Newsgroups: comp.lang.java.programmer Subject: Java 1.8 and CentOS Date: Wed, 13 Apr 2016 15:04:13 +0100 Organization: A noiseless patient Spider Lines: 151 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 13 Apr 2016 14:00:55 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="6099d291b215470bf292381b41facbca"; logging-data="26522"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185BKBVPtCXy6q2Wv0XueYrlLMpJN9FgCM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 Cancel-Lock: sha1:f9a1ncXpoRI2vGUZpfiYYMNzKgU= Xref: csiph.com comp.lang.java.programmer:34123 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