• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Old Codes, New Platform - Any Impacts?

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Old codes always run on newer JEE server.
That's good but I'm just wondering whether there's any impact
in terms of efficiency, performance, etc.

I thought of few scenarios:

1) old codes (v1.3), old compiler/binaries (v1.3)
2) old codes (v1.3), new compiler/binaries (v1.5)
3) new codes (v1.5), new compiler/binaries (v1.5)

* old codes meaning codes written with old syntax
* old compiler/binaries meaning classes generated with old jdk
* version number provided is just example


Any comments?


Thanks.
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Current production Java is 1.6, not 1.5.

Obviously, if you have old code, say 1.3 style, then you can't use any of the cool new features. But the current JVM should run it fine. Perhaps not optimally, but the JIT optimizations should do a good job anyway.

For me, the key thing in recent Java versions is support for generics and the enhanced for-loop construct. I use them all the time. I'd hate to go back and write code without them.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With each new version, new performance improvements are implemented in the JRE and JVM. The performance of a Java 5 JVM is quite a bit better than a Java 1.3 JVM, and Java 6 is again a step up from Java 5. By running your old code on a new JVM you'll benefit from the performance improvements. By re-compiling your old code you might get additional performance and efficiency benefits that are implemented in the Java compiler.

Sun and now Oracle have always been very careful about keeping newer versions of Java compatible with older versions, so when upgrading your Java platform everything should continue to work without changing anything to your source code. However, before doing this in a production environment, you should test carefully, because there are some cases where newer versions of Java are not 100% compatible with older versions, and there could also be code in your program that is written in such a way that it is not compatible with a newer version of Java.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An example of that last sentence is the use of classes in packages that start with sun, sunw or com.sun. Those packages are fully undocumented and the packages and/or classes inside them can change or be removed with any update, not just a major release. I have seen one application that required Java 1.4.2_08; event 1.4.2_10 broke the application.
 
reply
    Bookmark Topic Watch Topic
  • New Topic