问题描述
我有一个code.jar在1.7版本的java中运行得很好,但是当使用另一台带有1.6版本的linux的电脑时,它给我一个错误,我该如何在1.6版本中运行?使用。
如果只有 -target
选项在大多数其他回复中被推荐,1.7 SDK将发出警告关于 -bootclasspath
。该选项需要目标JRE版本的 rt.jar
(注意不 JDK)。它允许编译器检查引用核心Java SE的代码的类,方法和属性实际存在于 rt.jar
中。这对确保兼容性非常重要。
I have a code.jar running well in 1.7 version java, but when using another computer with linux with version 1.6 it is giving me an error, how can I run it in 1.6 version?
Use the cross-compilation options when invoking javac
.
If only the -target
option is specified as recommended in most other replies, the 1.7 SDK will issue a warning about -bootclasspath
. That option requires an rt.jar
of the target JRE version (note not JDK). It allows the compiler to check that the classes, methods and attributes of the code that reference core Java SE are actually present in the rt.jar
. This is very important to ensure compatibility.
这篇关于如何运行.jar 1.7程序与旧版本的java 1.6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!