Exception while compiling: wrong version 50.0, should be 49.0

一曲冷凌霜 提交于 2019-11-30 02:42:59

The library you're using was compiled with Java 6

Your compiler is Java 5 that's why it doesn't understand that format.

To fix it you have to get a 1.5 version of the library or upgrade your compiler to 1.6 I suggest the later.

Per http://www.jnode.org/node/2140...

Submitted by Stephen Crawley on Fri, 11/30/2007 - 07:15.

I suspect that you are mixing code compiled with different versions of Java. Class file version 50.0 is used by Java 6.0, and 49.0 is used by Java 5.0.

Try doing a "build clean" to get rid of all existing class files, followed by a regular build.

JNode is being developed using Java 6.0 only. Last time I tried, it didn't build using Java 5.0 (aka 1.5). (It is a problem with the program that builds the JNode boot image.)

Try changing the builder in Eclipse. If you're using 3.4, it's Project - Properties - Java Compiler - Enable Project Specific Settings - Compiler Compliance Level = 1.6. You'll prolly also need to have JRE 1.6 installed, as well.

Check you class path in eclipse and make sure that its the same class path your compiling to in the command prompt, also check your library imports

It means that, you have compiled that class with Java 6 and trying to execute with Java 5.

Solution :

If your using ant, execute below steps on the project root directory

  1. ant clean
  2. ant deploy

If your using eclipse, just clean the workspace(remove the class files which were compiled with Java6) and build again

this could be that in you IDE you point to latest version of JDK but when you build your program outside the IDE(maybe with maven) your java_home is the older version to the one on your IDE.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!