This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes classpaths containing wildcards Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "classpaths containing wildcards" Watch "classpaths containing wildcards" New topic
Author

classpaths containing wildcards

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

On Friday, I noticed that starting Java 6, command line classpaths can contain wildcards.

This is very cool! (and about time.) It's helpful when distributing a command line program. Especially with Maven since the jars contain version #s and change often.

(no this isn't a question; I hadn't known about the feature so wanted to post.)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2065
    
  22

Yeah I was happy when I saw that too. Actually, I forgot that Java didn't support wildchars, and I put wildchars in the classpath by mistake. I ran it, it worked, then I remembered Java doesn't support wildchars. That's when I "discovered" these feature
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

I was actually looking for whether -cp "commons-io-*;commons-lang-*" was legal so I could at least leave out the version numbers. And found I could specify the whole directory in one go!
Rupesh Bonthala
Greenhorn

Joined: Mar 08, 2007
Posts: 5
yep. nice feature. One important point is that if the order of jars in the folder is important for the application, then wild cards shouldn't be used as the order of loading of Jars may vary for each execution.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpaths containing wildcards
 
Similar Threads
Handling \n in Runtime.getRuntime().exec(commandArray)
Another classpath question
Copied Tomcat 6 webapp working fine on one server but not another
problem to rin openoffice
compiling java in command line with jar dependency and packages