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

869    Asked by alexGONZALEZ in Java , Asked on Apr 12, 2021

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 one version and executed in another version (new on old). However, I only have one version of JRE on my system. If I run the commands:

$ javac -version

javac 1.5.0_18

$ java -version

java version "1.5.0_18"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)

Java HotSpot(TM) Server VM (build 1.5.0_18-b02, mixed mode)

and check in Eclipse for the properties of the java library, I get 1.5.0_18

Therefore, I have to conclude something else, internal to a class itself, is throwing the exception?? Is that even possible?

Answered by Anurag Singhal

Your Answer

Interviews

Parent Categories