Error while using jxl to access Excel files
<p>I'm trying to write an applicate to read/write Excel spreadsheet files.
I haven't even done anything serious yet other than attempt to marry the JXL Java code to my Eclipse Android project. </p>

<p>I'm getting a failure:</p>

<pre class="lang-none prettyprint-override"><code>A fatal error has been detected by the Java Runtime Environment:
   Internal Error (classFileParser.cpp:3494), pid=4868, tid=6000  
   Error: ShouldNotReachHere()
JRE version: 6.0_26-b03  Java VM: Java HotSpot(TM) Client VM
(20.1-b02 mixed mode windows-x86)
</code></pre>

<p>My code is simply:</p>

<pre><code>package com.ulsanonline.gradebook;

import java.io.File;

import java.io.IOException;

import jxl.Cell;
import jxl.CellType;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.widget.EditText;

public class ImportStudents extends Activity {
    private String inputFile;
    private gradeBookDbAdapter mDbHelper;
    private EditText mNameText;
    private Long mRowId;

    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mDbHelper = new gradeBookDbAdapter(this);
        mDbHelper.open();

        setContentView(R.layout.exercise_list);
        setTitle("Import Students from File");

    }

    public void read() throws IOException {
        File inputWorkbook =
            new File(Environment.getExternalStorageDirectory() +
                 "/gradeBook/attendance.xls");
        if (inputWorkbook.exists()) {
            String fileName = inputWorkbook.getAbsolutePath();

            inputWorkbook = new File(inputFile);
            Workbook w;
            try {
                w = Workbook.getWorkbook(inputWorkbook);
                // Get the first sheet
                Sheet sheet = w.getSheet(0);
                // Loop over first 10 column and lines

                for (int j = 0; j &lt; sheet.getColumns(); j++) {
                    for (int i = 0; i &lt; sheet.getRows();
                         i++) {
                        Cell cell = sheet.getCell(j, i);
                        CellType type = cell.getType();

                        if (cell.getType() ==
                            CellType.LABEL) {
                            System.out.println("I got a label " +
                                 cell.getContents());
                        }

                        if (cell.getType() ==
                            CellType.NUMBER) {
                            System.out.println("I got a number " +
                                 cell.getContents());
                        }
                    }
                }
            }
            catch(BiffException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[]args) throws IOException {
        ImportStudents test = new ImportStudents();

        test.read();
    }
}
</code></pre>

<p>Any ideas on what went wrong?  </p>

<p>Thanks,
Martin</p>
