docs: protected ReturnCode generateServerEnv(boolean generatePassword) {
          double jvmLevel;
          String s = null;
          try {
              s = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<String>() {
                  @Override
                  public String run() throws Exception {
                      String javaSpecVersion = System.getProperty("java.specification.version");
                      return javaSpecVersion;
                  }
              });
              jvmLevel = Double.parseDouble(s);
          } catch (Exception ex) {
              // If we get here, it is most likely because the java.specification.version property
              // is not a valid double.  Return bad java version
              throw new LaunchException("Invalid java.specification.version, " + s, MessageFormat.format(BootstrapConstants.messages.getString("error.create.unknownJavaLevel"),
                                                                                                         s), ex, ReturnCode.ERROR_BAD_JAVA_VERSION);
          }
  
          BufferedWriter bw = null;
          File serverEnv = getConfigFile("server.env");
          try {
              char[] keystorePass = PasswordGenerator.generateRandom();
              String serverEnvContents = FileUtils.readFile(serverEnv);
              String toWrite = "";
              if (generatePassword && (serverEnvContents == null || !serverEnvContents.contains("keystore_password="))) {
                  if (serverEnvContents != null)
                      toWrite += System.getProperty("line.separator");
                  toWrite += "keystore_password=" + new String(keystorePass);
              }
              if (jvmLevel >= 1.8 && (serverEnvContents == null || !serverEnvContents.contains("WLP_SKIP_MAXPERMSIZE="))) {
                  if (serverEnvContents != null || !toWrite.isEmpty())
                      toWrite += System.getProperty("line.separator");
                  toWrite += "WLP_SKIP_MAXPERMSIZE=true";
              }
  
              if (serverEnvContents == null)
                  FileUtils.createFile(serverEnv, new ByteArrayInputStream(toWrite.getBytes("UTF-8")));
              else
                  FileUtils.appendFile(serverEnv, new ByteArrayInputStream(toWrite.getBytes("UTF-8")));
  
          } catch (IOException ex) {
              throw new LaunchException("Failed to create/update the server.env file for this server", MessageFormat.format(BootstrapConstants.messages.getString("error.create.java8serverenv"),
                                                                                                                            serverEnv.getAbsolutePath()), ex, ReturnCode.LAUNCH_EXCEPTION);
          } finally {
              if (bw != null) {
                  try {
                      bw.close();
                  } catch (IOException ex) {
                  }
              }
          }
          return ReturnCode.OK;
      }