You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Davanagere, Nagaraj" <Na...@umassmed.edu> on 2008/09/15 20:52:29 UTC

class file has wrong version 49.0, should be 48.0

Hi,

I had to use poi-3.5-beta1 for working with .xlsm files.
I use jdk 1.4.2

My java source compilation fails with the following exception.
    [javac] util\FileUploadHelper.java:12: cannot access
org.apache.poi.hssf.usermodel.HSSFCell
    [javac] bad class file:
lib\poi-3.5-beta1-20080718.jar(org/apache/poi/hssf/usermodel/HSSFCell.cl
ass)
    [javac] class file has wrong version 49.0, should be 48.0
    [javac] Please remove or make sure it appears in the correct
subdirectory of  the classpath.
    [javac] import org.apache.poi.hssf.usermodel.HSSFCell;
    [javac]                                      ^
    [javac] 1 error

Please let me know if we have to use only JDK 1.5 for working with
poi-3.5?

Thanks,
Nagaraj


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: class file has wrong version 49.0, should be 48.0

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> Here is the file I was trying to parse.
> Based on your feedback it looks like I need to use JDK 1.5.

Yes, that file is an OOXML file. You'll need to use java 1.5, and XSSF 
(see the docs that come with the poi 3.5 beta for how to do XSSF and HSSF 
with the same code)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: class file has wrong version 49.0, should be 48.0

Posted by "Davanagere, Nagaraj" <Na...@umassmed.edu>.
Thanks Nick.

Here is the file I was trying to parse.
Based on your feedback it looks like I need to use JDK 1.5.

Please confirm once again if am thinking right?

Thanks,
Nagaraj

-----Original Message-----
From: Nick Burch [mailto:nick@torchbox.com] 
Sent: Monday, September 15, 2008 4:02 PM
To: POI Users List
Subject: RE: class file has wrong version 49.0, should be 48.0

On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> I tried with poi-jdk14-3.5-beta1-20080718.jar and now I get a 
> different exception.
> (I am trying to parse a file with .xlsm type )

Is .xlsm a new, ooxml file? If so, you'll need to upgrade to java 1.5.
POI currently supports java 1.4 for the older OLE2 documents, but to
parse the new ooxml ones various dependencies are java 1.5 only. So, for
XSSF (to parse .xlsx files and similar), you need to be using java 1.5,
the normal (non -jdk14-) jar, and the -ooxml- jar (+ dependencies)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional
commands, e-mail: user-help@poi.apache.org



RE: class file has wrong version 49.0, should be 48.0

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> I tried with poi-jdk14-3.5-beta1-20080718.jar and now I get a different
> exception.
> (I am trying to parse a file with .xlsm type )

Is .xlsm a new, ooxml file? If so, you'll need to upgrade to java 1.5. POI 
currently supports java 1.4 for the older OLE2 documents, but to parse the 
new ooxml ones various dependencies are java 1.5 only. So, for XSSF (to 
parse .xlsx files and similar), you need to be using java 1.5, the 
normal (non -jdk14-) jar, and the -ooxml- jar (+ dependencies)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: class file has wrong version 49.0, should be 48.0

Posted by "Davanagere, Nagaraj" <Na...@umassmed.edu>.
Thanks Nick.

I tried with poi-jdk14-3.5-beta1-20080718.jar and now I get a different
exception.
(I am trying to parse a file with .xlsm type )

Unhandled Exception thrown: class
org.apache.poi.poifs.filesystem.OfficeXmlFileException
Root cause of ServletException.
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied
data appears to be in the Office 2007+ XML. POI only supports OLE2
Office documents
	at
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.
java:108)
	at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.j
ava:151) 


Please let me know if am using the correct library to parse this file?

Thanks,
Nagaraj

-----Original Message-----
From: Nick Burch [mailto:nick@torchbox.com] 
Sent: Monday, September 15, 2008 3:19 PM
To: POI Users List
Subject: Re: class file has wrong version 49.0, should be 48.0

On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> My java source compilation fails with the following exception.
>    [javac] util\FileUploadHelper.java:12: cannot access 
> org.apache.poi.hssf.usermodel.HSSFCell
>    [javac] bad class file:
> lib\poi-3.5-beta1-20080718.jar(org/apache/poi/hssf/usermodel/HSSFCell.
> cl
> ass)

If you're still on java 1.4, you'll want
poi-jdk14-3.5-beta1-20080718.jar instead of poi-3.5-beta1-20080718.jar.
It's in the binary download along with the jar you're using

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional
commands, e-mail: user-help@poi.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: class file has wrong version 49.0, should be 48.0

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> My java source compilation fails with the following exception.
>    [javac] util\FileUploadHelper.java:12: cannot access
> org.apache.poi.hssf.usermodel.HSSFCell
>    [javac] bad class file:
> lib\poi-3.5-beta1-20080718.jar(org/apache/poi/hssf/usermodel/HSSFCell.cl
> ass)

If you're still on java 1.4, you'll want poi-jdk14-3.5-beta1-20080718.jar 
instead of poi-3.5-beta1-20080718.jar. It's in the binary download along 
with the jar you're using

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org