| Author |
java 5 Vs 6
|
Naresh Chaurasia
Ranch Hand
Joined: May 18, 2005
Posts: 309
|
|
I am currently working on an application that was build using java 5.0. Recently I upgraded to java 6.0 and tried to build the application. The build fails. Is java 6.0 not backward compatible.
If i simply run my application on java 6.0 with out building (it has been build on java 5.0), will the application work fine.
Thanks in advance.
|
SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
|
 |
Martin Vanyavchich
Ranch Hand
Joined: Sep 16, 2008
Posts: 241
|
|
|
As far as I know Java is backwards compatible and you shouldn't experience troubles compiling. Might be, that code uses some features that were deprecated or something similar. Have you tryed using -source 1.5 switch when compiling? Maybe if you posted the errors you get when you compile we coud be of more help.
|
SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
Since you are not preparing for SCJP, neither is this question about SCJP, I'll move it to a more appropriate forum...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16811
|
|
Java 6 is supposed to be backward compatible with Java 5. However...
I have encountered a few Java 5 applications that will not compile correctly with Java 6. And I have encountered a Java 5 application, compiled with Java 5, that will not run correctly in Java 6. I guess there are flaws with the compatibility.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Runtime problems may occur, but building (compiling) should still work. Naresh, could you post your build error message(s)?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24081
|
|
|
Sometimes code does change meaning with a new JDK; these are generally obscure cases, but they can be a pain in the class. There are some overloaded versions of StringBuffer::append() that were added in JDK 1.4 and JDK 1.5. Code that in JDK 1.3 might have invoked append(Object) will now invoke append(StringBuffer). If you compile that code with a 1.5 JDK, even if you use -source 1.3 -target 1.3, it won't execute on a 1.3 JRE because that method will be missing. Like I said, obscure, but a huge pain if you bump into it.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Hebert Coelho
Ranch Hand
Joined: Jul 14, 2010
Posts: 754
|
|
|
I know about some problems with some drivers too. I got a problem with postgres drivers when migrating my app.
|
[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
|
 |
Raj chiru
Ranch Hand
Joined: Aug 12, 2008
Posts: 141
|
|
|
You got any class version error after building(compiling).
|
 |
 |
|
|
subject: java 5 Vs 6
|
|
|