This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes class file has wrong version 48.0, should be 47.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "class file has wrong version 48.0, should be 47.0" Watch "class file has wrong version 48.0, should be 47.0" New topic
Author

class file has wrong version 48.0, should be 47.0

Sooraj Godavarma
Greenhorn

Joined: Dec 13, 2005
Posts: 6
Hi,

I am using WSAD 5.1.2 and the server is Websphere Test Environment 5.0. We took an API from net which is used for drawing chars and graphs. But this uses JDK 1.4. (javax.nio.ImageIO etc..) or higher. But WSAD 5.1.2 defaults to JDK 1.3. So we went to Window-->Preferences--> Installed JRE's --> and added a new JRE and started pointing to it. Also, we changed JAVA_HOME to point to the new JRE(jre1.4.2_10) but the following error is still there.

The main error is with class file version. May be the server is expecting a diff. version of class file. So I deleted all class files from my web project as well as Java projects and gave a "Rebuild All". Still the error persists.

Can any one help me out in this? Please detail.


D:\MyApp_WORKSPACE\.metadata\.plugins\com.ibm.etools.server.core\tmp0\cache\localhost\server1\MyAppEAR\MyAppWeb.war\myapp\_index.java:4: cannot access org.uss.app.myapp.util.MyKeys

bad class file: D:\MyApp_WORKSPACE\MyAppEAR\MyAppJava.jar(org/uss/app/myapp/util/MyKeys.class)

class file has wrong version 48.0, should be 47.0

Please remove or make sure it appears in the correct subdirectory of the classpath.

[3/10/06 10:25:38:177 IST] 57e857e8 SystemErr R import org.uss.app.myapp.util.MyKeys;

[3/10/06 10:25:38:177 IST] 57e857e8 SystemErr R 1 error

[3/10/06 10:25:38:193 IST] 57e857e8 SystemErr R InsertTag oEndTag caught: javax.servlet.ServletException: Unable to compile class for JSP

[3/10/06 10:25:38:193 IST] 57e857e8 SystemErr R javax.servlet.ServletException: Unable to compile class for JSP
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
WebSphere using JDK 1.3, so make sure to set -target 1.3 when you use JDK 1.4 for compilation. Use -bootclasspath to add rt.jar from JDK 1.3


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
You are using incorrect java version.
juan bedoya
Greenhorn

Joined: Oct 20, 2006
Posts: 1
I don't know if all people now know how to solve this problem, this is what I did and it worked to me:

in websphere window-->preferences-->java-->compiler I select in compliance level: 1.3 and it was all it start to work fine.

Hope this help some one.

Bye
[ October 20, 2006: Message edited by: juan bedoya ]
av bharathiraja
Greenhorn

Joined: Aug 24, 2006
Posts: 7
Hi Ranchers.

Im getting the error while running apache ant1.6.1 even after setting PATH, class path, JAVA_HOME system environment variables to jdk1.3. Can anybody help me.


Regards<br />AV
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
av,

your situation may or may not be different from the one mentioned above. if you are using a library that relies on Java 1.4 (like the original poster did), then there is no way you'll get it to work under 1.3.

On the other hand, if it's your own code (and it does not use JDk 1.4-only features), then you should recompile it using the "-target" switch mentioned earlier, or -even better- recompile it using JDK 1.3.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: class file has wrong version 48.0, should be 47.0
 
Similar Threads
Logging in j2ee
Problem when installing RAR in Resoruce Adapters in WAS 5.1
JMS WSAD 5.1.1 (Embedded JMS Server not started)
websphere is always in starting mode in RAD7...
urgent help needed - Struts-Faces integration problem