Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wildcard on Classpath

 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • 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
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic