Created On:  6 August 2010

Problem

  • Product Name: VisiBroker for Java
  • Platform/OS version: All
The following exception is encountered when VisiBroker ORB is started.

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

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

            at java.lang.ClassLoader.defineClass(Unknown Source)

            ...

            at com.inprise.vbroker.orb.ORB.initializeServices(Unknown Source)

            at com.inprise.vbroker.orb.ORB.initialize(Unknown Source)

            at com.inprise.vbroker.orb.ORB.set_parameters(Unknown Source)

            at org.omg.CORBA.ORB.init(Unknown Source)

Resolution

SUN maintains forward compatibility for the compiled classes.  A Java application compiled in JDK 1.5 can be run with JRE 6.0.  However, an application compiled in JDK 1.5 will encountered the UnSupportedClassVersionError when run with a lower JDK like JRE 1.4.2.  The common root cause of the issue is the JAVA_HOME is pointed to a lower version of the JDK.  Follow the steps below to set the path and run the application again. 

·         PATH=/bin:$PATH
·         export PATH
·         which java
·         java -version
·         Run the application