This is a space where the community of Twproject users can ask for support, explanations,
and also vote up or down questions, answers and feature requests.
>> Back to Twproject 's site.

How can I upgrade Java's JDK in use on my server?

asked May 15 '12 at 03:57

Pietro%20Polsinelli's gravatar image

Pietro Polsinelli ♦♦
4687217

edited May 15 '12 at 03:57


Teamwork up to version 4.8 is compiled with Java JDK 1.5. Following versions are compiled with Java's JDK 6, and are hence incompatible with the JDK provided in previous installations. You can use JDK 6 or 7 with all Teamwork versions. Java JDK download is here:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

With the wrong JDK you may get the following exceptions:

javax.servlet.ServletException: Bad version number in .class file

or

java.lang.UnsupportedClassVersionError: Bad version number in .class file

There are several cases to consider:

  1. If you are using a Linux server, it is possible that you are not using the JDK provided by Teamwork's installer - you will be using an external one. You can upgrade it and as said above all Teamwork's versions will be fine.

  2. If you are using a OSX server, JDK is always external to Teamwork, and most likely you are already using JDK 6, so you will be fine.

  3. In case you are using the default installation on Windows or Linux machines, the global variable pointing to the JDK is JAVA_HOME.

Windows: Say you installed JDK 6 in C:Program Files (x86)Javajdk1.6.0_32. Modify the tw.bat lines from

set JAVA_HOME=..\jre

set CLASSPATH=..\jdk\lib\tools.jar;%BASEDIR%\bin\bootstrap.jar

to

set JAVA_HOME="C:\Progra~2\Java\jdk1.6.0_32\jre"

set CLASSPATH=C:\Progra~2\Java\jdk1.6.0_32\lib;%BASEDIR%\bin\bootstrap.jar

What is that Progra~2?? In order for the .bat to run, Java needs paths without spaces. So

Progra~1 = 'Program Files'

Progra~2 = 'Program Files(x86)'

If you get "Unrecognized VM option 'MaxPermSize128m'", change that with -XX:MaxPermSize=256m.

Linux: Analogously change the lines

JAVA_HOME="$BASEDIR"/jre

CLASSPATH="$BASEDIR"/bin/bootstrap.jar:"$BASEDIR"/jdk/lib/tools.jar

with the new paths.

In the Tomcat distributed by the installer, the launch files are in bin and are tw.bat or tw.sh; in the original Tomcat distribution, you'll need to do the changes above to catalina.sh (Unix based) or the catalina.bat (Windows based). Within each of the scripts you can set certain variables which only processes created under the shell will inherit. So for catalina.sh, use the following line:

export JAVA_HOME="intended java home"

And for windows use

set JAVA_HOME="intended java home"

License and support. Consider also that a new installation will require a version 5 license - version 4 licenses are not valid for version 5.

You can always ask Teamwork support to do the upgrade for you. If you have a Teamwork hosted, upgrade will be done by Teamwork support.

(If you have a comment or question about this FAQ please ask it in a new separate question. FAQ are meant as part of documentation.)

answered May 15 '12 at 04:03

Pietro%20Polsinelli's gravatar image

Pietro Polsinelli ♦♦
4687217

edited Jun 25 '12 at 11:47

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×21
×2
×1

Asked: May 15 '12 at 03:57

Seen: 1,300 times

Last updated: Jun 25 '12 at 11:47

| Twproject faq | about | contact us | Twproject blog | Twproject documentation | feedback always welcome