public static String encodeJavaOpts(String javaOpts){
  String javaOptsBase64=DatatypeConverter.printBase64Binary(javaOpts.getBytes(Charset.forName("UTF-8")));
  return String.format("\"%s\"",javaOptsBase64.replace("=","&equals;"));
}

public static String encodeJavaOpts ( String javaOpts ) { String javaOptsBase64 = DatatypeConverter . printBase64Binary ( javaOpts . getBytes ( Charset . forName ( "UTF-8" ) ) ) ; return String . format ( "\"%s\"" , javaOptsBase64 . replace ( "=" , "&equals;" ) ) ; }
encode the jvm options < br > 1 . convert it into base64 format < br > 2 . add \ " at the start and at the end < br > 3 . replace " = " with " & amp ; equals ; "
