Eclipse class version bug

那年仲夏 提交于 2019-12-25 01:49:49

问题


In eclipse 3.4 I'm trying to do some performance tests on a large product, one of the included libraries is the vecmath.jar (javax.vecmath package) from the Java3D project. Everything was working fine and then when trying to run it yesterday I get this exception/error not long after starting it up:

java.lang.UnsupportedClassVersionError: javax/vecmath/Point2f (Unsupported major.minor version 49.0)

Which I believe means that I'm trying to load a java 1.5 class file into a 1.4 jvm which is unsupported. However when I went to the class file to check this I saw this in the eclipse class file viewer:

Compiled from Point2f.java (version 1.2 : 46.0, super bit)

So the class loader says it is version 49.0 but the class file says its 46.0. I've tried cleaning and fully rebuilding the project, I've confirmed that the compiler version for the project is 1.4, the JRE is 1.4 and for the run configuration the 1.4 jvm is selected. I'm totally stuck on this, does anyone have any idea what might be causing this?

Thanks

===EDIT===

It turns out that a version of java3d which was incompatible with java 1.4.2 had been installed in C:\Program Files\java\j2re1.4.2_18\lib\ext. I installed a newer version of Java3D to play around with in java6 and i guess it installed the libs in all my JREs even the ones which were incompatible.


回答1:


Could there be another javax.vecmath.Point2f on your classpath?




回答2:


I believe JRE 1.5 is required for the latest version of Java3D.




回答3:


Have you checked:

Window
    -> Preferences
        -> Java
            -> Compiler
                -> Compiler Compliance Level

To see if this value is screwy?




回答4:


You have to add the

  1. "java_home : C:\Program Files\Java\jdk1.6.0_16"
  2. "path: C:\Program Files\Java\jdk1.6.0_16\bin;"

to your Environment Variables!



来源:https://stackoverflow.com/questions/226280/eclipse-class-version-bug

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