使用 Java 1.5 编译器,当我尝试编译依赖于使用 Java 1.6 编译的类的 java 类时,我收到此错误:
in/javac Java15.java
Java15.java:5: cannot access Java16
bad class file: ./Java16.class
class file has wrong version 50.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
String java16result = Java16.test();
^
1 error
反向工作(使用 Java 1.6 编译器,我可以链接到 Java 1.5 类。)
有什么解决方法吗?