• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Wildcard on Classpath

 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought I could use the wildcard character on the classpath to include a bunch of jars in a single directory but it's not working.
java -cp C:\dir\lib\*.jar myapp
Something wrong with my syntax?
Thanks,
Drew
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any solution to specify the classpath using wildcards?
No there's not. There is a Bug Report to fix this, I'm not sure when Sun will get round to fixing it.
In the meantime, you can do 3 things
- write your Java bootstrap program which reads in the list of Jar files recursivley and passes then as an argument to Runtime.getRuntime().exec("java...") etc.
- use a unix script to call java for you,this time using shell script to pick all the Jar files up from the relevant directory (for *.jar in dir $classpath = $classpath:jar ) etc
- extract all the jars to one place, then rezip them up and put that on your class path.
[ March 27, 2004: Message edited by: Marilyn de Queiroz ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic