Index: ModuleUpdater.java =================================================================== RCS file: /cvs/autoupdate/libsrc/org/netbeans/updater/ModuleUpdater.java,v retrieving revision 1.24.6.1.4.2 diff -r1.24.6.1.4.2 ModuleUpdater.java 364,365c364,366 < + "bin" + FILE_SEPARATOR; // NOI18N < String torun = java_path + "java -cp " + getMainDirString() + mconfig.getCommand(); // NOI18N --- > + "bin" + FILE_SEPARATOR + "java"; // NOI18N > java_path = quoteString(java_path); > String torun = java_path + " -cp " + quoteString(getMainDirString()) + mconfig.getCommand(); // NOI18N 647a649,669 > > /** Quotes string correctly, eg. removes all quotes from the string and adds > * just one at the start and > * second one at the end. > * @param s string to be quoted > * @return correctly quoted string > */ > public static final String quoteString(String s) { > if (s.indexOf(' ') > -1) { > StringBuffer sb = new StringBuffer(s); > int i = 0; > while (i < sb.length()) { > if (sb.charAt(i) == '\"') sb.deleteCharAt(i); > else i++; > } > sb.insert(0, '\"'); > sb.append('\"'); > return sb.toString(); > } > return s; > }