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: Re: Java 1.8 and CentOS Date: Thu, 14 Apr 2016 05:18:38 +0100 Organization: A noiseless patient Spider Lines: 98 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 14 Apr 2016 04:15:21 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="6099d291b215470bf292381b41facbca"; logging-data="19804"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ifq9A8KgOB3mAmc84rV+69ztNTOLEf04=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 In-Reply-To: Cancel-Lock: sha1:E3vFlaKX6G23zjF37uZExpCiC6I= Xref: csiph.com comp.lang.java.programmer:34129 On 13/04/16 19:14, Andreas Leitgeb wrote: > Andreas Leitgeb wrote: >> Duncan Idaho wrote: >>> 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 >> My somewhat older tomcat here doesn't yet have a "jsvc" in its bin, > I just installed jsvc directly (sudo apt-get install jsvc # ubuntu here) > > and idly called: > $ jsvc -home $JAVA_HOME java.lang.Object > -> Nothing. Probably somewhere an error got logged about > java.lang.Object.main not existing, but I don't care. > $ jsvc -home /some/existing/but/empty/dir java.lang.Object > -> Cannot find any VM in Java Home /some/existing/but/empty/dir > > Running the last one with "strace" showed, that it would try > a few locations inside the given java home to find libjvm.so . > > Running the exact jsvc invocation as determined with bash -x > (in my previous posting) with "strace" might reveal what's > wrong on CentOS Well this is interesting [root@vps opt]# cd jdk1.7.0_45/ [root@vps jdk1.7.0_45]# find . -name libjvm.so ./jre/lib/i386/server/libjvm.so ./jre/lib/i386/client/libjvm.so [root@vps opt]# cd jdk1.8.0_77/ [root@vps jdk1.8.0_77]# find . -name libjvm.so ./jre/lib/amd64/server/libjvm.so furthermore [root@vps bin]# ./jsvc -home /opt/jdk1.7.0_45 java.lang.Object returns no error to stdout [root@vps bin]# ./jsvc -home /opt/jdk1.8.0_77 java.lang.Object Cannot find any VM in Java Home /opt/jdk1.8.0_77 hmm, err, so then cd /opt/apache-tomcat-7.0.42/bin/commons-daemon-1.0.15-native-src/unix # ./configure Oh FFS, no gcc # yum group install .. # ./configure # make ... /usr/bin/ld: i386 architecture of input file `jsvc-unix.o' is incompatible with i386:x86-64 output ... oh **** wrong processor architecture go and get jdk-8u77-linux-i586.tar unpack, change JAVA_HOME /etc/rc.d/init.d/tomcat7 start Oh joy, Tomcat now runs under Java 1.8 I knew someone here would have the answer. It was a rookie mistake, wrong processor architecture, my excuse is that I'm tired after weeks of doing battle with a new server that uses systemd init as opposed to sysV init.d which is what I'm used to Thanks Andreas -- Duncan Idaho