Is Java bytecode compatible with different versions of Java?

Nope! Class files are forward compatible only. Java 5 introduced new classfile attributes and format changes, to handle Varargs, enums, and generics.

Java 4 would just fail when processing these.

Nope! . Class files are forward compatible only.

Java 5 introduced new classfile attributes and format changes, to handle Varargs, enums, and generics. Java 4 would just fail when processing these. However, there is the unsupported -target jsr14 option on javac that generates JDK 1.4-compatible bytecode for some Java 5 language features.

Also, there are projects (e.g. Retroweaver, Retrotranslator) that convert Java 5 classfiles into Java 4 files. EDIT: I found this good resource: Using Java 5 language features in earlier JDKs.

I gave you the answer for that Link to retroweaver/retrotranslator. That might take care of my follow up question, thank you. – James McMahon Aug 12 '09 at 15:45 1 I found retrotranslator to work flawlessly with my application, I had some problem with retroweaver.

– Thorbjørn Ravn Andersen Aug 12 '09 at 16:28.

No. You can only move upwards - Java 1.4 bytecode will work on Java 5 runtimes. However, if you aren't using any functionality not found in Java 1.4, you can compile using the -target and -source options of javac.

If you want to use Java 5 to write an application that can be run on Java 4, you can't use any features that weren't present before Java 5.

No they are not. . Class files are forward compatible only.

Java5 framework implies that your library is probably using generics or annotations that are incompatible with your 1.4 environment. You have to evaluate how much risk there is for you to run your 1.4 application under a 1.5 JVM to enable use of the frameworks you require. In general I've found moving to 1.5 to be mostly painless, but diligent testing is called-for.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions