Empty value to system properties in IDEA Run/Debug configuration
intellij-idea
Solution
I don't see that there is a problem with that.
I created a little test program and it works well even if the properties are converted.
package com.stackoverflow;
/**
* @author maba, 2012-10-24
*/
public class Main {
public static void main(String[] args) {
String property = System.getProperty("my-property");
System.out.println("property = " + property);
String property2 = System.getProperty("my-property2");
System.out.println("property2 = " + property2);
String property3 = System.getProperty("my-property3");
System.out.println("property3 = " + property3);
}
}
And with the following in IntelliJ:
When running I will get this output:
property = abc
property2 =
property3 = afd
The formatted system properties will be correct when you run because the command line will be like this:
"C:\Program Files\Java\jdk1.6.0_33\bin\java" -Dmy-property=abc -Dmy-property2= -Dmy-property3=afd <lots of jars> com.stackoverflow.Main
I.e. the `-Dmy-property2=` will be empty string.
Problem
I want to have "Run" configuration inside IntellJ IDEA with some java system properties predefined (ordinary and easy task). But by some reasons I need to set some properties to empty string -- which is not so easy in IDEA: ``` -Dmy-property=abd -Dmy-property2= -Dmy-property3=afd ``` if I enter this in "system properties" input, it will be converted to ``` -Dmy-property=abd -Dmy-property2=-Dmy-property3=afd ``` IDEA removed "unused" whitespaces. This is not desirable. Currently I can solve this only by moving empty property to th end of list. Is there any other way to enter emtpy property value?