java.lang.UnsupportedClassVersionError: Bad version number in .class file error while executing

I am using UWC to covert my Mediawiki pages into text file which I will later import it to Confluence. My Mediwiki is installed on a linux box and I am using command line to export the pages. UWC is installed on the same machine on which Mediawiki is present. The Java version is JDK 1.5.0_10. When I run the command I am getting following error:

uwc$ /bin/bash -e conf/

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(





at Method)


at java.lang.ClassLoader.loadClass(

at sun.misc.Launcher$AppClassLoader.loadClass(

at java.lang.ClassLoader.loadClass(

at java.lang.ClassLoader.loadClassInternal(

Can anyone help me out with this issue?

1 answer

1 accepted

1 vote
Accepted answer

This error will be thrown when you try and load a class thats been compiled with an incompatible (usually future) version of Java.

From your question it looks like the class you're trying to run was compiled using Java 6 and you're using Java 5 to run it. Try upgrading your JVM to 6 and give it another go.

Hi Matthew,

Thanks for your reply.

I have downloaded the from and its mentioned in the documentation that any version of Java 5 or higher should be fine for the installation and running UWC. So I was wondering why it didn't work when I have JDK 1.5.0_10 installed on my m/c.

I downloaded the converter, extracted the starting point class and confirmed its been compiled without java 5 support:

$ file ./com/atlassian/uwc/ui/UWCCommandLineInterface.class
./com/atlassian/uwc/ui/UWCCommandLineInterface.class: compiled Java class data, version 50.0 (Java 1.6)

I'm going to do some investigating as to why this is the case or if its just an oversight.

Yeah, that's my bad. I've updated the doc to say it requires Java 6 now. It's not so much that we couldn't support Java 5. It's just that at this point, I'm using Java 6, and when I build the UWC and one of the dependencies (confluence remote java wrapper), I happen to be using 6. So, if you need it to support 5, and you're willing to build from source, it _should_ be possible, but you have to not only build the UWC against 5, but also the CRJW library and update the lib directory with the resulting jar.

Thanks Laura !! I am sure it will avoid confusion to others who will be using UWC.

One quick question. Do you know if we can use UWC to export only subset of Mediawiki?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Friday in Agile

Are you a Jira Service Desk agent? We want to talk to you!

Are you a whiz at handling tickets and looking at how you can further optimize your workflow with automation? Do you tackle detailed customer support questions while simultaneously getting flooded wi...

58 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you