server.addSystemProperty("java.endorsed.dirs");
JavaProcess[] processes = new JavaProcess[] {server, client};
for(int i = 0; i < processes.length; i++) {
JavaProcess process = processes[i];
for(Iterator it = System.getProperties().entrySet().iterator(); it.hasNext();) {
Entry entry = (Entry) it.next();
String key = entry.getKey().toString();
if(key.startsWith(process.getName() + ":")){
int pos = key.indexOf(':') + 1;
String property = key.substring(pos);
String value = entry.getValue().toString();
System.out.println("Adding (" + property + ", " + value + ")");
process.addSystemProperty(property, value);
}
}
}