cancel
Showing results for 
Search instead for 
Did you mean: 

Excetion "UnsupportedClassVersionError: Bad version number in .class file"

Former Member
0 Kudos

Hi,

Actually I am new to BO Java SDK. When i try to run the java class file from the cmc, the instance shows sucess.But the log generated on the Unix throws an exception. I checked the versions on the job server (Its JDK 1.5) and where i am developing my code and compiling is Eclipse (It has also JDK 1.5). But the thing is why i am getting this kind of exception (UnsupportedClassVersionError: Bad version number in .class file).Could anyone help me in solving this exception.

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(ClassLoader.java:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at com.crystaldecisions.sdk.plugin.desktop.program.internal.ProgramWrapper.main(ProgramWrapper.java:49)

Thanks,

Ohm

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

When a Java program object is run by the program job server, it does not use the version of Java that ships with BOE. Instead, it uses the version of Java that %JAVA_HOME% points to for Windows. I assume the same is true for Unix as well. Run java -version to see what version is the default for your system and check that against the compliance level of your code.

Former Member
0 Kudos

On my local machine i do have java version

H:\>java -version

java version "1.6.0_18-rev"

Java(TM) Platform, Standard Edition for Business (build 1.6.0_18-

Java HotSpot(TM) Client VM (build 16.0-b15, mixed mode, sharing)

So waht do i need to do now.

former_member189544
Contributor
0 Kudos

Hi,

the exception that is thrown by the class loader on the BOE server is quite typical if the class file you try to run on the plattform was compiled with a newer JDK version that the one that is used on the BOE server.

Doublecheck the version on the server with the version of your compiler. If you use eclipse look in your projects properties under Java compiler and adjust according to the version on the server. After compiling with another compiler you need to upload the java programm again or replace the file directly in the FileStore. Typically there is no other reason for this error.

Regards,

Harald

ted_ueda
Employee
Employee
0 Kudos

XI 3.x, the JDK path is specified by the registry setting:


HKLM\SOFTWARE\Business Objects\Suite 12.0\Installer\JDKPath

The default is the Java JVM supplied with SAP BusinessObjects.

Having it specified by JAVA_HOME would lead to all sorts of admin issues.

In pretty much all cases I've encountered, cause of the issue was that the compile version was newer than the one being used.

Sincerely,

Ted Ueda

Answers (0)