It's not a secret anymore!
The moose likes Beginning Java and the fly likes NoClassdefFound in Unix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NoClassdefFound in Unix" Watch "NoClassdefFound in Unix" New topic

NoClassdefFound in Unix

Swapnil Shroff
Ranch Hand

Joined: Mar 07, 2006
Posts: 58
I am running a program like

And I am getting an error as

However I have added all the jars in cp. I also tried using -classpath.
Any idea why the problem. thanks

SCJP 5, SCDJWS<br /> <br />It's amazing how premature optimisation is both seductive and destructive; even when you know
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32803

Have you tried putting the classpath in quotes as follows?

java -cp "JMdsAPI.jar:JTib.jar:jcachetek.jar:util.concurrent.jar:junit.jar:log4j-1.2.14.jar"

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Kevin Smither
Ranch Hand

Joined: Oct 22, 2007
Posts: 30
try fully qualifying the path to the jars, such as...

java -classpath /libs/log4j-1.2.14.jar

etc. etc. The issue is that it can't find the jar so there are only 2 possibilities, the full path to the jar needs to be specified or the jar does not exist.
I agree. Here's the link:
subject: NoClassdefFound in Unix
jQuery in Action, 3rd edition