• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java 5 Vs 6

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are not preparing for SCJP, neither is this question about SCJP, I'll move it to a more appropriate forum...
 
Henry Wong
author
Marshal
Pie
Posts: 21446
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Rob Spoor
Sheriff
Pie
Posts: 20613
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime problems may occur, but building (compiling) should still work. Naresh, could you post your build error message(s)?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know about some problems with some drivers too. I got a problem with postgres drivers when migrating my app.
 
Raj chiru
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You got any class version error after building(compiling).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic