• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFound Exception

 
sonia arora
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to use jexcelapi to generate output in excel sheet.
i am able to compile the file .
but when i run it by command prompt as:
java -classpath "c:\program files\jexcelapi\jxl.jar ";"c:\program files\java\jdk1.6.0_18\bin" create
then error is encountered that is:
"Exception in thread "main" java.lang.NoClassDefFoundError:;
caused by: java.lang.NoClassFoundException:,
....
cound not find main class:,program will exit.


but the create.class file is there in bin folder. then why this exception .
can anyone help?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"c:\program files\jexcelapi\jxl.jar ";"c:\program files\java\jdk1.6.0_18\bin"

That's not the right way to specify paths. Try "c:\program files\jexcelapi\jxl.jar;c:\program files\java\jdk1.6.0_18\bin" instead. Note that the "bin" directory should not contain any classes or jar files, and thus should not be part of the classpath.
 
sonia arora
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. issue got resolved.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic