WebSphere MQ v7.1 and Java v1.4.2

Here’s another head-banging item that some people may get burnt by.

I was doing some testing of Java applications with WebSphere MQ v7.1 and received the following error message:

java.lang.UnsupportedClassVersionError: com/ibm/mq/MQException (Unsupported major.minor version 49.0)
   at java.lang.ClassLoader.defineClass0(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
Exception in thread "main"

If you do not know what “Unsupported major.minor version 49.0” means, in plain English, it means that the MQ Java JAR file you are using was built with a higher release of Java (i.e. v1.5) and is not backwards compatible with Java v1.4.2.

When I switched my JDK to version 1.5 then everything worked fine with my test application.

I searched the WebSphere MQ v7.1 documentation and cannot find anything about WebSphere MQ v7.1 now requiring Java v1.5 or higher. Attention IBM: This needs to be documented.

So be warned: If you are using Java (JDK or JRE) v1.4.2 (or lower) then you will not be able to use the MQ Java JAR files from the newly released WebSphere MQ v7.1 with your application.

Regards,
Roger Lacroix
Capitalware Inc.

This entry was posted in IBM i (OS/400), IBM MQ, Java, JMS, Linux, Unix, Windows, z/OS.

2 Responses to WebSphere MQ v7.1 and Java v1.4.2