Question

I have some enterprise apps running on Java 1.4. They mostly invoke Stored Procedures on a DB, Parse XML files (at the most few megs large), read and write from and to disk. We have a requirement where now we have to migrate these apps to Java 6(No code changes to be done at all).

My questions:

  • If I don't recompile my apps under Java 6 and just run them with it, will it work fine (I know they 'should')? But if somebody thinks other way round, could you kindly share your thoughts please?
  • More important question is - Will it have any performance impact?. As in, App compiled on 1.4 and running on 1.6 vs App compiled and running on 1.6. Is 1.6 going to do any bytecode optimization for the same old piece of code compared to 1.4?

Many Thanks js

Was it helpful?

Solution

It's not the byte code that gets optimized, the byte code format hasn't changed since Java 1(!). The JVM will optimize those parts of the code where runtime analysis tells it that it is worthwhile, but in the JIT-compiled native code. And yes, the step from 4 to 6 should result in better performance - virtual machines have come a long way in those 4.5 years.

OTHER TIPS

For build compatibility from 1.4 to 1.6 Check for enum variables - it is a new reserved word

This isn't really a compilation issue, but you may find some problems arise from the integration of certain third-party components into the JDK between 1.4 and 6. I've had issues with some XML- and WS- related components in the past, eg xerces/xalan.

Even where packages/namespaces have changed (and therefore your existing components will probably continue to be used by your code) some odd auto-discovery things happen in the background which can cause incompatible versions of these components to clash.

Using the endorsed classloader/folder may resolve any issues without much effort.

My advice - if you haven't already, try it as soon as you can and see.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top