Problem Running Application (Java + Excel Doc)

T

TheNewf

I have to be honest. This is my first attempt at writing an application
and I have run in to a large road block. I am trying to read an MS
Excel 2000 Document with Java (Using the Java Excel API @
http://www.andykhan.com/jexcelapi/). I have been writing this program
in the NetBeans IDE 4.0 which had been working well for me, i get some
warnings but nothing too bad. When I compile and run the progran with
NetBean it works, but when i try to run it in dos using java -jar it
give me:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
jxl/read/biff/BiffException
at workapp2.Main.actionPerformed(Main.java:124)
at javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown
Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

My first thought is their is something with the Java Excel API i am
using but... i can't seem to see a problem. I have tried to look at the
documentation for the Java Excel API, but I have finally run in to a
block. Any help would be appreachated.

Thanks,

The Newf
 
B

Betty

I have to be honest. This is my first attempt at writing an application
and I have run in to a large road block. I am trying to read an MS
Excel 2000 Document with Java (Using the Java Excel API @
http://www.andykhan.com/jexcelapi/). I have been writing this program
in the NetBeans IDE 4.0 which had been working well for me, i get some
warnings but nothing too bad. When I compile and run the progran with
NetBean it works, but when i try to run it in dos using java -jar it
give me:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
jxl/read/biff/BiffException
at workapp2.Main.actionPerformed(Main.java:124)
at javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
<snip>

I had this same problem, I put the jar file in my classpath and it worked.
 
T

TheNewf

I have tried to add it to the manifest file. but it still doesn't seem
to work. One thing I did notice is that in the NetBeans IDE i had to
modify the source compiling options to associate to the file.

What I tried was in the manifest file:

Main-Class: workapp2.Main
Class-Path: jxl.jar

i placed a copy of the jxl.jar in the same directory as the files for
the jar. I am still getting the errors above when i try just to run the
jar from dos using: java -jar WorkApp2.jar. the program runs fine until
it gets to the point were it needs to read the excel document, where it
craps out?

The Newf
 
B

Betty

I have tried to add it to the manifest file. but it still doesn't seem
to work. One thing I did notice is that in the NetBeans IDE i had to
modify the source compiling options to associate to the file.

What I tried was in the manifest file:

Main-Class: workapp2.Main
Class-Path: jxl.jar

i placed a copy of the jxl.jar in the same directory as the files for
the jar. I am still getting the errors above when i try just to run the
jar from dos using: java -jar WorkApp2.jar. the program runs fine until
it gets to the point were it needs to read the excel document, where it
craps out?

I don't remember all the steps I went through to figure this out
by trial and error, but I quit as soon as it worked.
My classpath (Windows XP Pro). I took out the things that
were specific to my environment like c:\bin;
echo %classpath%
.;
..;
..\..;
c:\Shareware\jExcelAPI\jexcelapi\jxl.jar;

I have a copy of jxl.jar in my highest level source directory.

C:\Eclipse3.1M2\workspace\NewDraw\src\jxl.jar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top