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 Classpath issue 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 "Classpath issue" Watch "Classpath issue" New topic

Classpath issue

Dominic Steng�rd
Ranch Hand

Joined: Feb 05, 2001
Posts: 186
Hey JavaGurus,

Ive packaged my POJO application in a JAR file together with its third party libraries such as Log4j.

The structure of the executable jar file is as follows:

The issue Im having is that when I execute

I get the following error:

Seems as if cannot find my log4j.jar files.
So the question is:
How do I set the classpath to refer to a library jar file (log4j.jar) that is contained in another jar file?

Thanks in advance!

Kind regards

Dominic Steng�rd<br />Sun Certified Java 2 Programmer
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

You can't nest .jar files. I was going to try:


but I haven't tried it yet.
Consider Paul's rocket mass heater.
subject: Classpath issue
Similar Threads
wierd logging issue with my app
Bugged with slf4j
Accessing classes in other jars from my jar
JasperReport problem
Eclipse Plug-in and dependencies from other JARs