java.lang.UnsupportedClassVersionError: Bad version number in .class file?

后端 未结 10 562
逝去的感伤
逝去的感伤 2020-11-22 12:56

I am getting this error when I include an opensource library that I had to compile from source. Now, all the suggestions on the web indicate that the code was compiled in o

10条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 13:39

    Have you tried doing a full "clean" and then rebuild in Eclipse (Project->Clean...)?

    Are you able to compile and run with "javac" and "java" straight from the command line? Does that work properly?

    If you right click on your project, go to "Properties" and then go to "Java Build Path", are there any suspicious entries under any of the tabs? This is essentially your CLASSPATH.

    In the Eclipse preferences, you may also want to double check the "Installed JREs" section in the "Java" section and make sure it matches what you think it should.

    You definitely have either a stale .class file laying around somewhere or you're getting a compile-time/run-time mismatch in the versions of Java you're using.

提交回复
热议问题