Wouldn't you be better served with using a "Launcher" main class, whose function is just to dispatch the calls to the actual controller classes, and using a link file as a final wrapper, instead of fiddling with the -cp option of the wm?
In windows, it is surprisingly easy to do so.
The "main class" needs not be anything much complex, something like
/**
* Sample launcher
*/
public class Launcher {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
if (args != null && args.length > 0) {
String option= args[0];
String[] args2=new String[0];
if( args.length>1){
args2= new String[args.length-1];
System.arraycopy(args, 1, args2, 0, args2.length);
}
if(option.equals("a")) {
new ClassA().exec(args2);
}
else if(option.equals("b")){
new ClassB().exec(args2);
}
}
}
}
On the windows side of things, it is enough something like creating a link of this kind
javaw.exe -jar "jarfile" "a"
It is very useful for placing link in the "sendTo" folder... one jar, hidden, called by many links that activate one of its aspects makes simpler to deploy updates of the jar logic.
The actual files selected are passed as a list of string after the params in the link definition.
This way, you should not worry about the whole classpath issues.