Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

Problem Running Application (Java + Excel Doc)

Thread view: 
TheNewf@gmail.com - 07 May 2005 05:18 GMT
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
Betty - 08 May 2005 17:51 GMT
> 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
[quoted text clipped - 10 lines]
>         at javax.swing.AbstractButton.fireActionPerformed(Unknown
> Source)
<snip>

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

> 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
[quoted text clipped - 4 lines]
>
> The Newf
TheNewf@gmail.com - 08 May 2005 23:40 GMT
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
Betty - 09 May 2005 03:42 GMT
> 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
[quoted text clipped - 10 lines]
> 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

> The Newf


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.