Bug 10307 - Invalid class file format:
Summary: Invalid class file format:
Status: CLOSED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: Other Solaris
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-28 03:03 UTC by Imron
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Imron 2002-06-28 03:03:47 UTC
Hi...

I always got "Invalid class file format:" error during compilation
I didn't get any error message when "jakarta-poi-1.5.1-final-bin.tar.gz" 
downloaded from its site. has no problem with unzipped (#gzip -d filename).
To open the archive I used 
#tar xvfi jakarta-poi-1.5.1-final-bin.tar.gz
since always encounter checksum error I use "xvfi".

Therefore I rename the file to make my CLASSPATH simpler...
then I compile... and got the error... as shown below...


I tried to build my own poi*.jar, but seemed too complicated to me
as I know it needs another product "ant" ???

hope it clear enough...

Thanks in advance...

Detail as follow:
------------------------------------------------------
# CLASSPATH=/usr/imron/wjava:/usr/imron/wjava/poi.jar:.
# export CLASSPATH
# javac HSSFTest1.java
error: Invalid class file format: /usr/imron/wjava/poi.jar(org/apache/poi/hssf/u
sermodel/HSSFWorkbook.class), wrong version: 46, expected 45
HSSFTest1.java:47: Class org.apache.poi.hssf.usermodel.HSSFWorkbook not found in
 type declaration.
        HSSFWorkbook wb = new HSSFWorkbook();
        ^
HSSFTest1.java:47: Class org.apache.poi.hssf.usermodel.HSSFWorkbook not found in
 type declaration.
        HSSFWorkbook wb = new HSSFWorkbook();
                              ^
3 errors
# more HSSFTest1.java
//package wroxbeans;

import java.io.*;
import java.util.Date;
import org.apache.poi.hssf.usermodel.*;
import java.lang.*;

public class HSSFTest1 {

    private String dirName;
    private String fileName;
    private String mailAddress;
    private String dummyData;
    private String defDummyData;
    private String slash;

    public HSSFTest1() {
        dirName = "d:";
        fileName = "HSSFTest1.xls";
        slash = "\\";
        mailAddress = "sdc-tmsd2@fujitsu.co.id";
        dummyData = "Dummy created on " + new Date();
        defDummyData = "default Dummy created on " + new Date();
    }

    public void setDirName(String dName) {
        dirName = dName;
    }
    public void setFileName(String fName) {
        fileName = fName;
    }
    public void setMailAddress(String mAddr) {
        mailAddress = mAddr;
    }
    public void setDummyData(String dData) {
        dummyData = dData;
        if (dData == null || dData.equals(""))
            dummyData = defDummyData;
    }

    public void setSlash(String sl) {
        slash = sl;
    }

    public synchronized void generateExcel() {
        // create work book
        HSSFWorkbook wb = new HSSFWorkbook();
        // create sheets
        HSSFSheet sheet1 = wb.createSheet("New Sheet!!!");
        HSSFSheet sheet2 = wb.createSheet("Second Sheet!!!");
        // get row
        HSSFRow row = sheet1.createRow((short)0);
        // get cell and put value in it
        HSSFCell cell = row.createCell((short)0);
        cell.setCellValue(dummyData);

        // writing to file
        try {
            FileOutputStream fileOut = new FileOutputStream(dirName + slash + fi
leName);
            wb.write(fileOut);
            fileOut.close();
        }catch(IOException e) {
            e.printStackTrace();
        }
    }
}
#
------------------------------------------------------
Comment 1 Natasha Marell 2002-07-03 20:21:52 UTC
Check your compiler! Symantec 3 can cause this problem.

http://groups.google.com/groups?
q=error+binclass+java++group:comp.lang.java.programmer&hl=en&lr=&ie=UTF-
8&oe=UTF-8&selm=7t2ct3%24tbj%241%40nnrp1.deja.com&rnum=1
Comment 2 Andy Oliver 2002-07-15 00:48:23 UTC
did you try ./build.sh compile ?
Comment 3 Glen Stampoultzis 2002-07-21 03:39:29 UTC
No response.  Closing.
Comment 4 Glen Stampoultzis 2002-07-21 03:40:39 UTC
No response.  Closing.