Here you can find the source of encodeJavaOpts(String javaOpts)
public static String encodeJavaOpts(String javaOpts)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.nio.charset.Charset; import javax.xml.bind.DatatypeConverter; public class Main { /**/* w ww . java2 s . c o m*/ * 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 "&equals;" * * @return encoded string */ public static String encodeJavaOpts(String javaOpts) { String javaOptsBase64 = DatatypeConverter.printBase64Binary(javaOpts.getBytes(Charset.forName("UTF-8"))); return String.format("\"%s\"", javaOptsBase64.replace("=", "=")); } }