简体   繁体   中英

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.

If they pass, your application is by definition compatible with that JVM.

Try Java Compatibility Test Tools. See details from here .

You can pass -target 1.6 to the compiler. However, this does NOT guarantee that the bytecode runs with 1.6. It may fail at runtime with Linkage Error when your code uses later API that is not available in 1.6.

You can use Animal Sniffer to detect you code's compatibility with certain Java version.

Or just use a 1.6 compiler ... this is probably the best approach. Always use the lowest compiler version you need to be compatible with.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM