This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
+ "bin" + FILE_SEPARATOR; // NOI18N
+ "bin" + FILE_SEPARATOR + "java"; // NOI18N
String torun = java_path + "java -cp " + getMainDirString() + mconfig.getCommand(); // NOI18N
java_path = quoteString(java_path);
--
String torun = java_path + " -cp " + quoteString(getMainDirString()) + mconfig.getCommand(); // NOI18N
/** 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;