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

不羁岁月 提交于 2020-01-04 05:34:08

问题


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?


回答1:


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



回答2:


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.




回答3:


Yes, java has backwards compatibility.

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



来源:https://stackoverflow.com/questions/10663291/wondering-whether-i-need-to-installll-jdk-1-6-1-7-together

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!