In my install4j installer I set VM option from installer variable:
${installer:proxyHostVM}
Can I do it only if variable available and isn't empty ?
You have to set the "Condition expression" property of the "Add VM options" action that you use to set this VM parameter:
String value = (String)context.getVariable("proxyHostVM");
return value != null && !((String)value).isEmpty()