It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Answer accepted

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published yesterday in Off-topic

Teams behind the teams - Your nominations please!

Teams do amazing things together. We’ve talked about the myth of the lone genius and how everything is actually the result of teamwork. You might be thinking, What about a novelist writing, say, Th...

84 views 0 8
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