简体   繁体   English

如何确保java程序与Java Enviornment 6兼容?

[英]How do I make sure that a java program is compatible with Java Enviornment 6?

如何确保我的java程序与Java Enviornment 6兼容?

Run all your tests with the target JVM. 使用目标JVM运行所有测试。

If they pass, your application is by definition compatible with that JVM. 如果它们通过,则根据定义,您的应用程序与该JVM兼容。

Try Java Compatibility Test Tools. 尝试Java兼容性测试工具。 See details from here . 这里查看详细信息。

You can pass -target 1.6 to the compiler. 您可以将-target 1.6传递给编译器。 However, this does NOT guarantee that the bytecode runs with 1.6. 但是,这并不能保证字节码以1.6运行。 It may fail at runtime with Linkage Error when your code uses later API that is not available in 1.6. 当您的代码使用1.6中没有的后续API时,它可能会在运行时因链接错误而失败。

You can use Animal Sniffer to detect you code's compatibility with certain Java version. 您可以使用Animal Sniffer检测代码与某些Java版本的兼容性。

Or just use a 1.6 compiler ... this is probably the best approach. 或者只使用1.6编译器......这可能是最好的方法。 Always use the lowest compiler version you need to be compatible with. 始终使用您需要兼容的最低编译器版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何确保在 Java 中只选择了一个 JRadioButton? - How Do I Make Sure Only One JRadioButton Is Selected In Java? java有条件的我如何确保它检查所有的if语句 - java conditional how do I make sure it checks all if statements 我如何使这个Java 7兼容? - How would I make this Java 7 compatible? 如何确保我的 tensorFlow Java 程序在 Windows 上使用我的 GPU? - How can I make sure that my tensorFlow Java program is using my GPU on Windows? 如何创建程序以确保 3 个或更多字符不在序列中 - How do I create a program to make sure 3 or more characters are not in a sequence 我如何制作一个java程序来检查字符串中是否有元音? - how do I make a java program to check if there is a vowel in a string? 我如何使我的android程序的背景变为Java? - How do i make the background of my android program colored in java? 对于 Java,如果我想做一个 if 语句以确保输入只包含一个字符,我应该如何进行? - For Java, if I want to do an if statement to make sure the input only takes in one character, how should I proceed? 如何为Java程序制作最终的可执行文件? - How do I make a final executable file for my Java program? 如何用一种方法制作最简单的Java程序? - How do I make the simplest Java program with one method?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM