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


When call a shared library, a java.lang.UnsupportedClassVersionError: Bad version number in .class file exception occurs.


A compile-time/run-time mismatch in the versions of Java.

The library was compiled for Java1.6; however, it was running with Java1.5.


In the Ant build file, specify the version of source and target in the javac task to match the run-time Java version.

For example:

<javac … source=”1.5″ target=”1.5″/>




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s