Reputation: 115
I have created the project using the JDK 1.4. Now I want to use JDK 1.6 version in my project. for this what steps are required.Means I want to know the what changes is require in code to get a JDK 1.6 feature.Basically I am talking about the features that is added in JDK 1.6. If any one list out that changes it is very helpful.
Thanks in advance..............................
Upvotes: 3
Views: 27052
Reputation: 718768
I have created the project using the JDK 1.4. Now I want to use JDK 1.6 version in my project. For this what steps are required.
Actually, there is (almost) nothing that you need to start to make a JDK 1.4 application run using JDK 1.6. In nearly all cases, you simply need to recompile the code with the JDK 1.6 compiler and run it in a JDK 1.6 JVM. The only problems you are likely to encounter are:
If your code uses "enum" as an identifier, you will need to change it to something else. enum
is a keyword starting in Java 1.5.
If your code directly depends on Sun proprietary / internal classes, you may need to deal with unannounced API changes.
You might find the certain official API classes or methods have been marked as deprecated.
There are a small number of changes in API implementations / behaviors with each release that may impact your application. These are typically highlighted in the document on upgrading.
Once you have got your application working on Java 1.6, you can then think about whether and when to start using the Java 1.5 language extensions, and the new / enhanced APIs in the class libraries.
Means I want to know the what changes is require in code to get a JDK 1.6 feature.
Almost no changes are required. But obviously, if you want or need to use a new feature you will need to change your code to do that.
Wikipedia has an summary of the most significant changes made across various Java releases.
UPDATE
As of May 2014, Java 6 has been "end-of-lifed", and Java 8 has been released for a month or so (with no significant early release number dramas). You should now be thinking about moving to at least Java 7, and probably Java 8.
The same principles apply. Recompile and run your regression tests, and you will most likely to be good to go. Then start learning all about the Java 8 language extensions.
Upvotes: 4
Reputation: 4179
There are so many changes added in 6.0.
However all your 1.4 code will run smoothly. For further reference about the version please see the following link
http://en.wikipedia.org/wiki/Java_version_history#Java_SE_6_.28December_11.2C_2006.29
Hope it helps.
Upvotes: 1
Reputation:
There is a big difference in behaviour for volatile keyword in 1.5 - more along the lines of C# away from C++ behaviour. But it only makes the code safer. So no code changes.
Upvotes: 0
Reputation: 16577
Better to see differences between 1.4 and 1.5 and then between 1.5 and 1.6. You can check new features in each version on official web site, but below is a little chronology ...
JDK 1.0 (january 23, 1996) oak
JDK 1.1 (february 19, 1997)
J2SE 1.2 (December 8, 1998) playground This and subsequent releases through J2SE 5.0 were rebranded retrospectively Java 2 & version name "J2SE" (Java 2 platform, Standard edition) replaced JDK to distinguish the base platform from J2EE (java 2 platform, enterprise edition) and J2ME (java 2 platform, micro edition).
J2SE 1.3 (may 8, 2000) kestrel
J2SE 1.4 (february 6, 2002) merlin
J2SE 5.0 (september 30, 2004) tiger [originally numbered 1.5]
Java SE 6 (december 11, 2006) mustang sun replaced the name "J2SE" with java se and dropped the ".0" from the version number. Beta versions were released in february and june 2006, leading up to a final release that occurred on december 11, 2006. The current revision is update 20.
Java se 6 update 10 A major enhancement in terms of end-user usability.
Java se 6 update 12 This release includes the highly anticipated 64-bit java plug-in (for 64-bit browsers only), windows server 2008 support, and performance improvements of java and JAVAFX applications.
...........
You can check in wikipedia till latest update.
Upvotes: 18
Reputation: 68942
The important details on 1.5 extensions are covered in these slides which provides also code examples.
Upvotes: 0
Reputation: 114767
To my opinion, the four most prominent enhancements since Java 1.4.2 are
There are a lot of additional classes and API enhancements, but if you want to 'upgrade' your code, I'd suggest to start your refactoring with using generics and replacing standard for loops by enhanced for loops. Both can be done without major code changes, clean up the code (you can delete a lot of lines of code) and improve readability. And using generics might reveal some hidden bugs ;)
Upvotes: 7