Results 1 to 2 of 2
  1. #1
    DC200 is offline Member
    Join Date
    Dec 2008
    Rep Power

    Default JExcelAPI: java.lang.NoClassDefFoundError: jxl/Workbook

    Cross post from new-java/26805-installing-java-libraries.html. I didn't know which other sub-forum to put this in.

    I'm getting the following error during runtime while attempting to use the JExcelAPI:

    Java Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: jxl/Workbook
    	at demo.main(
    Caused by: java.lang.ClassNotFoundException: jxl.Workbook
    	at Method)
    	at java.lang.ClassLoader.loadClass(
    	at sun.misc.Launcher$AppClassLoader.loadClass(
    	at java.lang.ClassLoader.loadClass(
    	at java.lang.ClassLoader.loadClassInternal(
    	... 1 more
    The jar has been put into jre/lib/ext and the test code compiles fine with import jxl.*, but still no luck. It can see the package, but why can't it find the class definition?

    This is the code I'm trying to test: Workbook workbook = Workbook.getWorkbook(new File("excel.xls"))
    Last edited by DC200; 03-21-2010 at 01:13 AM.

  2. #2
    DC200 is offline Member
    Join Date
    Dec 2008
    Rep Power


    I seem to have found a temporary solution to this problem. After trying unsuccessfully to modify the classpath, I unpacked the jar and moved the folder "jxl" into the same directory as the class files I was trying to run. No runtime errors at all.

Similar Threads

  1. java.lang.NoClassDefFoundError
    By AndrewM16921 in forum Java Applets
    Replies: 3
    Last Post: 09-29-2009, 07:54 PM
  2. java.lang.NoClassDefFoundError
    By noobie in forum Java Applets
    Replies: 5
    Last Post: 04-22-2009, 03:35 AM
  3. java.lang.NoClassDefFoundError:
    By jeepcreep11 in forum New To Java
    Replies: 3
    Last Post: 03-13-2009, 12:58 PM
  4. java.lang.NoClassDefFoundError
    By J_a_y in forum New To Java
    Replies: 2
    Last Post: 08-07-2007, 12:51 PM
  5. java.lang.NoClassDefFoundError
    By fred in forum Advanced Java
    Replies: 3
    Last Post: 08-01-2007, 06:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts