File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpaths containing wildcards

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33691
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Jayesh A Lalwani
Rancher
Pie
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 33691
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic