Sponsors: Michael Fertik - Best JAVA Web hosting Company & 30% off


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2010, 12:10 AM
Member
 
Join Date: Dec 2008
Posts: 37
Rep Power: 0
DC200 is on a distinguished road
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:

Code:
Exception in thread "main" java.lang.NoClassDefFoundError: jxl/Workbook
	at demo.main(demo.java:10)
Caused by: java.lang.ClassNotFoundException: jxl.Workbook
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
	... 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 12:13 AM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 03-21-2010, 01:08 AM
Member
 
Join Date: Dec 2008
Posts: 37
Rep Power: 0
DC200 is on a distinguished road
Default
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.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.NoClassDefFoundError AndrewM16921 Java Applets 3 09-29-2009 06:54 PM
java.lang.NoClassDefFoundError noobie Java Applets 5 04-22-2009 02:35 AM
java.lang.NoClassDefFoundError: jeepcreep11 New To Java 3 03-13-2009 11:58 AM
java.lang.NoClassDefFoundError J_a_y New To Java 2 08-07-2007 11:51 AM
java.lang.NoClassDefFoundError fred Advanced Java 3 08-01-2007 05:00 PM


Java Forums is supported by the best jsp hosting.

All times are GMT +2. The time now is 09:23 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org