简体   繁体   English

JDK 1.6编译代码调用JDK 1.5编译代码。 我们会看到什么错误?

[英]JDK 1.6 compiled code call a JDK 1.5 compiled code. what errors will we see?

If a class compiled with JDK 1.6 calls another class compiled with JDK 1.5, what kind of errors will we see? 如果使用JDK 1.6编译的类调用使用JDK 1.5编译的另一个类,我们将看到哪种错误?

  • Class Not found exception? 类未找到异常?
  • Class cast exception? 类强制转换异常?
  • NoSuch method exception? NoSuch方法异常?

You should encounter no problems doing this. 您应该不会遇到任何问题。 I have a code library with packages compiled with everything from 1.2 to 1.4 and have had absolutely no problems using it with applications compiled with Java 5 and Java 6. 我有一个代码库,其中包含从1.2到1.4的所有程序包进行编译,并且在将其与用Java 5和Java 6编译的应用程序一起使用时绝对没有问题。

I was getting the error ' Caused by: java.lang.NoClassDefFoundError :" file name 我收到错误信息' 原因:java.lang.NoClassDefFoundError :“文件名

  1. Check for the file whether deploy in correct path in server or not. 检查文件是否在服务器中正确的路径中部署。
  2. If deploy correctly and still not picking then check the environment java version and Eclipse java version.Both should be matched. 如果正确部署并且仍然无法选择,请检查环境Java版本和Eclipse Java版本。两者都应匹配。
  3. If not matching then took the file from environment and recompile the java file in eclipse by setting the Eclipse compilation configuration changing to the Environment java version. 如果不匹配,则通过将Eclipse编译配置更改为Environment Java版本,从环境中取出文件并在eclipse中重新编译Java文件。
  4. Deploy it in server and Enjoy. 在服务器中部署它并享受。

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

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