0

Is it possible to run small code snippet run with jdk 5 and rest of code with jdk 6?

Have one code which is working fine with jdk 5. I am going to change it as per jdk 6 but currently don't have time to do this. So is there any way to execute 4 lines with jdk 5.

Seems like funny but it's required.... please suggest me....

user1041580
  • 209
  • 2
  • 6
  • 13
  • why are you trying to do that? JDK 5 and JDK6 can run the same code and are compatible. – Aniket Inge Oct 18 '12 at 12:17
  • What is the code that is causing you a problem? – jalynn2 Oct 18 '12 at 12:17
  • 1
    *"Seems like funny but it's required"* What seems less funny is that you thought the reasons were not worth mentioning. At least 3 people think different. – Andrew Thompson Oct 18 '12 at 12:20
  • As you can run Java 1.0 byte code on Java 7, what sort of migration from Java 5.0 to Java 6 are you doing? – Peter Lawrey Oct 18 '12 at 12:24
  • It's not about byte code. Trying to create one html file using jasperreport_4.1.2.1.jar. same code same setup is working fine with jdk 5. And gives me distorted UI with jdk 6(html file which generated with jasperreport jar). It's about File handling.... – user1041580 Oct 18 '12 at 12:59

1 Answers1

2

Anything developed with JDK5 will be compatible with JDK 6 (from a source code perspective) and will run on a JRE 6 JVM. Note the distinction between source-code/compilation and the actual running of the resultant bytecode. So I don't think you need to do anything other than compile/run with JDK/JRE 6.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
  • Trying to create one html file using jasperreport_4.1.2.1.jar. same code same setup is working fine with jdk 5. And gives me distorted UI with jdk 6(html file which generated with jasperreport jar). – user1041580 Oct 18 '12 at 12:34