Two Laptop Bag
The moose likes Beginning Java and the fly likes Classpaths and Jar files. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Classpaths and Jar files." Watch "Classpaths and Jar files." New topic
Author

Classpaths and Jar files.

Thomas Young
Greenhorn

Joined: Jul 17, 2008
Posts: 29
If a directory is provided in the classpath, and that directory contains jar files, do the jar files get included? or must you additionally specify each jar file in the classpath?

Regards,
TY.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24054
    
  13

In Java 6 (and no previous version), you can use classpath wildcards -- i.e. entries like "/path/to/jardirectory/*". Otherwise, including a directory in which jars exist does nothing -- the jars are not automatically included.


[Jess in Action][AskingGoodQuestions]
Thomas Young
Greenhorn

Joined: Jul 17, 2008
Posts: 29
Hi Ernest,
Thanks for the clarification, especially in highlighting the Java 6 difference.

Regards,
TY.
ashok ballu
Ranch Hand

Joined: Sep 17, 2007
Posts: 30
Your quote:
---------------------------------------------------------------------------
"If a directory is provided in the classpath, and that directory contains jar files, do the jar files get included? or must you additionally specify each jar file in the classpath?"
--------------------------------------------------------------------------
According to my experience,If we include a directory/Folder to classpath , then all the jar files will be searched. No need to maintion each and every jar file explicitly
[ November 04, 2008: Message edited by: ashok ballu ]

ASHOK BALLU SCJP1.5 SCWCD1.5
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Classpaths and Jar files.
 
Similar Threads
In Eclipse, how to add log4j.properties to classpath ?
Java Mail problem
Using j2ee packages
simple code not working from tutorial
Exception in thread main