Problem Running Application (Java + Excel Doc)

Discussion in 'Java' started by TheNewf@gmail.com, May 7, 2005.

  1. Guest

    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
     
    , May 7, 2005
    #1
    1. Advertising

  2. Betty Guest

    <> wrote in message
    news:...
    > 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.

    > 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, May 8, 2005
    #2
    1. Advertising

  3. Guest

    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
     
    , May 8, 2005
    #3
  4. Betty Guest

    <> wrote in message
    news:...
    > 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


    >
    > The Newf
    >
     
    Betty, May 9, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Wallace
    Replies:
    0
    Views:
    477
    John Wallace
    Jul 22, 2003
  2. Matt
    Replies:
    3
    Views:
    510
    Tor Iver Wilhelmsen
    Sep 17, 2004
  3. Praveen Chhangani

    Converting a org.jdom DOC to org.w3c DOC

    Praveen Chhangani, Aug 5, 2003, in forum: XML
    Replies:
    2
    Views:
    971
    Johannes Koch
    Aug 7, 2003
  4. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,526
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  5. News123
    Replies:
    0
    Views:
    297
    News123
    Feb 6, 2010
Loading...

Share This Page