Change Java Version

I have a client server server running java 1.3; I want to change to java 1.6 step by step, that is, the first few clients than other clients and, finally, the server ... I wondered if you could direct me to some common problems that may arise and what I should look after ?

+7
java compatibility jvm version versions
source share
6 answers

Sun is trying to maintain a high level of backward compatibility, so you can simply install the new JVM and restart the application with it.

A document describing backward incompatibility with Java 1.6 with an earlier version is here . This document links compatibility documents for Java 1.5 and Java 1.4 . You will probably want to read these documents to learn about possible traps.

Java 1.5 and Java 1.6 introduced a new class of files. The JVM will also run old class files, but recompiling your code, especially with JDK 1.6, will help the new JVM take advantage of some changes to speed up your application. Therefore, you might consider recompiling.

In addition, some new keywords were added, namely assert (in 1.4) and listing (in 1.5) (as Yuval already mentioned). If you use these words as identifiers, recompilation will fail, but old class files will work. You can provide the -source javac switch to compile: ' javac -source 1.3 ' will compile the code without assert and enum as a keyword.

+11
source share

At the top of the head, find the names enum and assert in the fields and local variables ... These words became keywords in java 1.4 and 5. The java 6 compiler marks them as compilation errors if it sees them.

Yuval = 8-)

+4
source share

Sun maintains a list of incompatibilities that are introduced with each new version of Java.

The latest document for 1.4.2 has links to JDK 1.0 compatibility notes.

+4
source share

Sun JVM backward compatibility is generally very good, but not perfect. I saw three very large applications migrate from 1.3 to 1.5 and face a small number of problems, the largest of which was one Swing mask, which entered an endless event loop and froze the application under 1.4

The server side is unlikely to cause problems, but in Swing there were quite large changes under the hood, especially between 1.3 and 1.4 - the focus subsystem was completely rewritten, for example.

It is still possible that the application will work without problems, but you should definitely do extensive testing.

+3
source share

When I moved from 1.4.2 to 1.5 to the small applet I was working on, a lot of things happened: the screen update received all the uncomfortable, moved items, etc.

Sun JRE does not support backward compatibility for everything. Sometimes, when items are out of date, they completely go away after a very short period of time.

We wrote everything using the Java stock, using the Sun libraries as well.

I also saw several applications written in pure Java that work fine on one or two platforms in the same JRE version as the others with this version (the product I work with now works fine on Windows, fine on Mac OS X , decent on Linux, but not working on Solaris - all with the same JRE).

Moving versions is not an easy step if the application is really small.

+2
source share

My experience is that compatibility is pretty high. I only found one application that I could not run in the current version. For some reason (without a source, so I did not delve into it) that one application will not work for anything other than 1.4.2. Everything else that I have ever encountered (some of them were quite significant) reached 1.6 just fine. No changes are required.

YMMV, of course, so you have to try and see ...

0
source share

All Articles