Home : "bad class file. class file has wrong version 50.0, should be 4x.0."
Q183240 - ERRMSG: "bad class file. class file has wrong version 50.0, should be 4x.0."

"bad class file. class file has wrong version 50.0, should be 4x.0."

When compiling your code using the JAR files packaged with J-Integra for COM v2.7 or J-Integra for Exchange v2.7 (excel2007.jar & cdo.jar respectively) , you may receive an error similar to the one below:

SampleProgram.java:28: cannot access com.intrinsyc.cdo.Session
bad class file: C:\Program Files\J-Integra\Exchange\lib\cdo.jar(com/intrinsyc/cdo/Session.class)
class file has wrong version 50.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
            Session session = new Session(CDOmachine);
            ^
1 error

These types of errors are caused by a Java version mismatch between the compiled proxies and your runtime.

Below are a list of some of the version numbers and their corresponding Java runtimes:
Version 50.0 = Java 1.6.x
Version 49.0 = Java 1.5.x
Version 48.0 = Java 1.4.x

To resolve this issue, regenerate the proxies using com2java and compile them with your version of the Java SDK.  Alternatively, you can download some precompiled proxies from our Precompiled Java Proxy JAR Files KB article.
 
Note: The downloadable proxies were compiled using Java 1.4, except for Excel 2007, which for compatibility reasons, was compiled using Java 1.5.

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 4/19/2007.
Last Modified on 6/12/2007.
Last Modified by J-Integra KB Admin.
Article has been viewed 137728 times.
Rated 5 out of 10 based on 168 votes.
Print Article
Email Article