This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes NoClassDefFoundError with CSVReader? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NoClassDefFoundError with CSVReader?" Watch "NoClassDefFoundError with CSVReader?" New topic
Author

NoClassDefFoundError with CSVReader?

Todd Patrick
Ranch Hand

Joined: Jan 30, 2004
Posts: 31

[Details]:

SunOS 5.8 Generic_117350-27 sun4u sparc SUNW,UltraAX-MP
javac 1.5.0_06
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)


[Issue]:

I've been fighting the following error. I don't have a CLASSPATH defined. At this point, Is it an issue with trying to use the CSVReader class?


[Error]:

Exception in thread "main" java.lang.NoClassDefFoundError: au/com/bytecode/opencsv/CSVReader
at dtn.refinedfuels.EAIParser.main(Unknown Source)


[Command ran to produce error]:

java company.refinedfuels.EAIParser


[Ant build.xml file]:




[Java Class]:


[ May 17, 2006: Message edited by: Todd Patrick ]

--Todd
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
You need to set the classpath to tell java the location of the opencsv-1.3.jar

something like : (Assuming you are in the build directory to start this.)

java -cp ./;../source/lib/opencsv-1.3.jar company.refinedfuels.EAIParser


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: NoClassDefFoundError with CSVReader?
 
Similar Threads
build.xml ... what am I doing wrong?
Ant CLASSPATH Question
[Ant]Does not run java task
running jar file error:
How do I use a path as an argument without breaking the -classpath option?