S
Superman859
Guest
I am trying to run some Java code with Tomcat but just found out Plesk is still using Java 1.4.2 (ancient). I'm pretty new to using Java on a server and to using Tomcat, so I'm not quite sure how to fix this issue. My code requires Java 1.5 or higher.
I found that the java installation was in /usr/lib/jvm/java (I believe this is where it was linked to), and I downloaded Java 1.5 and now have the folder /usr/lib/jvm/jdk1.5.0_17.
So, I should have the needed files, but now I need the server to recognize them. After some searching, I thought I could change JAVA_HOME in /etc/tomcat5/tomcat5.conf and simply point it to the new directory. I did this, restarted Tomcat, and I haven't noticed any change. The program still runs as before and throws an exception when it requires features of Java 1.5.
Does anyone know what I need to do to get Tomcat pointing to the new Java files so I can use Java 1.5 code? Do I simply need it to reload tomcat5.conf somehow? Or, is changing JAVA_HOME in that file not going to make a difference?
From what I understand, upgrading Tomcat is a pain with Plesk, but upgrading Java shouldn't cause any issues provided the current version of Tomcat can handle it (and Tomcat5 shouldn't have trouble with Java5).
EDIT:
More specifically, running System.getProperty() in Tomcat provides this info:
Version: 1.4.2 Home: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
So the home directory is /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre based on what Tomat is seeing. However, tomcat5.conf initially had JAVA_HOME="/usr/lib/jvm/java" which points to /etc/alternatives/java_sdk, which points to /usr/lib/jvm/java-1.4.2-gcj, which finally points to /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0, which is an actual folder and seems to match what Tomcat System.getProperty() is getting at.
It's a little confusing, because there are a bunch of links involved all jumping back and forth between a few locations just to finally arrive at that one folder. However, it makes me think that indeed the JAVA_HOME setting for tomcat5.conf might be something to look at, because it ultimately does seem to point to what System.getProperty() points out (without the jre folder specifically, anyways). But I tried replacing JAVA_HOME and restarting Tomcat but nothing changed...
I found that the java installation was in /usr/lib/jvm/java (I believe this is where it was linked to), and I downloaded Java 1.5 and now have the folder /usr/lib/jvm/jdk1.5.0_17.
So, I should have the needed files, but now I need the server to recognize them. After some searching, I thought I could change JAVA_HOME in /etc/tomcat5/tomcat5.conf and simply point it to the new directory. I did this, restarted Tomcat, and I haven't noticed any change. The program still runs as before and throws an exception when it requires features of Java 1.5.
Does anyone know what I need to do to get Tomcat pointing to the new Java files so I can use Java 1.5 code? Do I simply need it to reload tomcat5.conf somehow? Or, is changing JAVA_HOME in that file not going to make a difference?
From what I understand, upgrading Tomcat is a pain with Plesk, but upgrading Java shouldn't cause any issues provided the current version of Tomcat can handle it (and Tomcat5 shouldn't have trouble with Java5).
EDIT:
More specifically, running System.getProperty() in Tomcat provides this info:
Version: 1.4.2 Home: /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
So the home directory is /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre based on what Tomat is seeing. However, tomcat5.conf initially had JAVA_HOME="/usr/lib/jvm/java" which points to /etc/alternatives/java_sdk, which points to /usr/lib/jvm/java-1.4.2-gcj, which finally points to /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0, which is an actual folder and seems to match what Tomcat System.getProperty() is getting at.
It's a little confusing, because there are a bunch of links involved all jumping back and forth between a few locations just to finally arrive at that one folder. However, it makes me think that indeed the JAVA_HOME setting for tomcat5.conf might be something to look at, because it ultimately does seem to point to what System.getProperty() points out (without the jre folder specifically, anyways). But I tried replacing JAVA_HOME and restarting Tomcat but nothing changed...
Last edited by a moderator: