Re:Reasons to be excited about Java in 2013
by ZoFreX on Saturday January 05, 2013 @07:20AM
(#5012417)
Bytecode is not made incompatible with every release, actually - for example the generics added in 1.5 use type erasure, and so are a compile-time-only feature, leaving the bytecode still compatible with 1.4 JVMs.
Re:Reasons to be excited about Java in 2013
by guard-of-terra on Saturday January 05, 2013 @08:30AM
(#5012561)
You're confusing JVM versions with Java versions.
A JVM class compiled for JVM 6 target will not run under JVM 1.4. It will fail to load because of version mismatch.
However, you can use Java 6 compiler to compile Java 6 code to JVM 1.4 bytecode. That's what you are talking about.
Re:Reasons to be excited about Java in 2013
by ZoFreX on Saturday January 05, 2013 @10:18AM
(#5012819)
Yes, I am. I got confused over what you meant by " It will warn you if you use any >1.4 features" - I thought you meant language >1.4, not bytecode spec >1.4. Thanks for setting me straight :)
Re:Reasons to be excited about Java in 2013
by guard-of-terra on Saturday January 05, 2013 @10:21AM
(#5012830)
I actually meant "language features that require bytecode spec >1.4".
Varargs and enums perhaps?
However, you can have compiler generate lower version bytecode for you. If you have a Java 8 compiler but want Java 1.4 bytecode - no problem, just ask compiler to target 1.4. It will warn you if you use any >1.4 features. Maybe it will even let you use lambdas (maybe not, I'm not sure).
Java is very backwards compatible. That's why it progresses so slowly perhaps.