File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes UnsupportedClassVersionError: org/apache/poi/hssf/usermodel/HSSFWorkbook (Unsupported major.minor ve Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "UnsupportedClassVersionError: org/apache/poi/hssf/usermodel/HSSFWorkbook (Unsupported major.minor ve" Watch "UnsupportedClassVersionError: org/apache/poi/hssf/usermodel/HSSFWorkbook (Unsupported major.minor ve" New topic
Author

UnsupportedClassVersionError: org/apache/poi/hssf/usermodel/HSSFWorkbook (Unsupported major.minor ve

Davood Shaik
Greenhorn

Joined: Feb 07, 2012
Posts: 2
Hello All,

My code is

IPortalComponentRequest componentRequest = (IPortalComponentRequest) this.getRequest();
String strPublicResourcePath = componentRequest.getPublicResourcePath() + "\\resources\\DefaultCurrency.xls" ;
InputStream fs = new FileInputStream(strPublicResourcePath);
HSSFWorkbook wb;
if(fs != null){
wb = new HSSFWorkbook(fs); //<<== Runtime Exception
}

Result :

Compilation is successful

Runtime Exception:

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
Caused by: java.lang.UnsupportedClassVersionError: org/apache/poi/hssf/usermodel/HSSFWorkbook (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:540)
at com.sapportals.portal.prt.util.AutoClassLoader.findClassInternal(AutoClassLoader.java:880)
at com.sapportals.portal.prt.util.AutoClassLoader.loadClassLocally(AutoClassLoader.java:1250)
at com.sapportals.portal.prt.util.AutoClassLoader.loadClass(AutoClassLoader.java:1388)
at com.sapportals.portal.prt.util.AutoClassLoader.loadClass(AutoClassLoader.java:1357)
at com.sapportals.portal.prt.util.AutoClassLoader$2.run(AutoClassLoader.java:1465)
at java.security.AccessController.doPrivileged(Native Method)


JAR files :

poi-2.5.1.jar
poi-contrib-2.5.1-final-20040804.jar
poi-scratchpad-2.5.1-final-20040804.jar

JDK Compiler Compliance level : 1.4

Server Version : 1.4.2_32-b03

It is the IDE problem or JVM problem or code problem.
Please let me know. Thanks a Lot.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

The UnsupportedClassVersionError happens when you compile a Java application with a more recent version fo the JDK than what you are running with. For example if you compile with JDK 6 and then try to run with JDK 5. In your case, it looks like you are using JDK 1.4 while the Apache JAR you are using was compiled with 1.5. You need to upgrade the JDK you are using.


JBoss In Action
Davood Shaik
Greenhorn

Joined: Feb 07, 2012
Posts: 2
Peter Johnson wrote:The UnsupportedClassVersionError happens when you compile a Java application with a more recent version fo the JDK than what you are running with. For example if you compile with JDK 6 and then try to run with JDK 5. In your case, it looks like you are using JDK 1.4 while the Apache JAR you are using was compiled with 1.5. You need to upgrade the JDK you are using.




Thank You.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: UnsupportedClassVersionError: org/apache/poi/hssf/usermodel/HSSFWorkbook (Unsupported major.minor ve
 
Similar Threads
How to use POI
NoClassDefFoundError
Converting Old POI Reading .xls Files to POI 3.7 Issues
Jakarta POI help
Hssf error