Adam Lee
Adam Lee

Reputation: 25738

Wondering whether I need to installll JDK 1.6 & 1.7 together?

Can I use JDK 1.7 to compile the code written in JDK 1.6? Is Java strict downward compatible?

Do I need to keep JDK 1.6 and JDK 1.7 together in the same machine?

Upvotes: 2

Views: 2314

Answers (3)

Andrew Thompson
Andrew Thompson

Reputation: 168815

Can I use JDK 1.7 to compile the code written in JDK 1.6?

Yes.

Is Java strict downward compatible?

If the cross-compilation options are specified when compiling. Those are most notably:

  • -source
  • -target
  • -bootclasspath - which requires an rt.jar of the JRE (not JDK) being targeted

Upvotes: 4

NPE
NPE

Reputation: 500167

Can I use JDK 1.7 to compile the code writtern in JDK 1.6?

Yes you can.

Do I need to keep JDK 1.6 and JDK 1.7 together in the same machine?

You can install them both on the same machine. Whether you need both depends on what exactly you're trying to do.

Upvotes: 2

richarbernal
richarbernal

Reputation: 1059

Yes, java has backwards compatibility.

With the latest jdk you have enought, but you can keep the two jdks without problems

Upvotes: 1

Related Questions