title: Invalid maximum heap size: -Xmx512m
body: <p>I have tried with all possible heap sizes for JVM, but I keep getting the below exception. </p>
  
  <pre><code>Admin pc@Admin-PC MINGW64 /c/controller/opendaylight (master)
  $  /c/apache-maven-3.3.9/bin/mvn clean install
  Error: Could not create the Java Virtual Machine.
  Error: A fatal exception has occurred. Program will exit.
  Invalid maximum heap size: -Xmx512m
  </code></pre>
  
  <p>Note - Don't mark this as duplicate, because I have tried with all solutions here but unable to find a final fix for this.</p>
  
  <p>EDIT NOTES- Adding debug information</p>
  
  <pre><code>$ bash -x /c/apache-maven-3.3.9/bin/mvn clean install
  + '[' -z '' ']'
  + '[' -f /etc/mavenrc ']'
  + '[' -f '/c/Users/Admin pc/.mavenrc' ']'
  + cygwin=false
  + darwin=false
  + mingw=false
  + case "`uname`" in
  ++ uname
  + mingw=true
  + '[' -z 'C:\Program Files\Java\jdk1.7.0_80' ']'
  + '[' -z 'C:\apache-maven-3.3.9' ']'
  + false
  + true
  + '[' -n 'C:\apache-maven-3.3.9' ']'
  ++ cd 'C:\apache-maven-3.3.9'
  ++ pwd
  + M2_HOME=/c/apache-maven-3.3.9
  + '[' -n 'C:\Program Files\Java\jdk1.7.0_80' ']'
  ++ cd 'C:\Program Files\Java\jdk1.7.0_80'
  ++ pwd
  + JAVA_HOME='/c/Program Files/Java/jdk1.7.0_80'
  + '[' -z '/c/Program Files/Java/jdk1.7.0_80' ']'
  + '[' -z '' ']'
  + '[' -n '/c/Program Files/Java/jdk1.7.0_80' ']'
  + '[' -x '/c/Program Files/Java/jdk1.7.0_80/jre/sh/java' ']'
  + JAVACMD='/c/Program Files/Java/jdk1.7.0_80/bin/java'
  + '[' '!' -x '/c/Program Files/Java/jdk1.7.0_80/bin/java' ']'
  + '[' -z '/c/Program Files/Java/jdk1.7.0_80' ']'
  + CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
  + false
  ++ find_maven_basedir
  ++ local basedir
  ++ local wdir
  +++ pwd
  ++ basedir=/c/controller/opendaylight
  +++ pwd
  ++ wdir=/c/controller/opendaylight
  ++ '[' /c/controller/opendaylight '!=' / ']'
  ++ '[' -d /c/controller/opendaylight/.mvn ']'
  +++ cd /c/controller/opendaylight/..
  +++ pwd
  ++ wdir=/c/controller
  ++ '[' /c/controller '!=' / ']'
  ++ '[' -d /c/controller/.mvn ']'
  ++ basedir=/c/controller
  ++ break
  ++ echo /c/controller
  + MAVEN_PROJECTBASEDIR=/c/controller
  ++ concat_lines /c/controller/.mvn/jvm.config
  ++ '[' -f /c/controller/.mvn/jvm.config ']'
  +++ tr -s '\n' ' '
   ' echo '-Xmx512m
    -Xmx512M -XX:MaxPermSize=256M'
  + false
  + export MAVEN_PROJECTBASEDIR
  + MAVEN_CMD_LINE_ARGS=' clean install'
  + export MAVEN_CMD_LINE_ARGS
  + exec '/c/Program Files/Java/jdk1.7.0_80/bin/java' $'-Xmx512m\r' $'\r' -Xmx512M -XX:MaxPermSize=256M -classpath /c/apache-maven-3.3.9/boot/plexus-classworlds-2.5.2.jar -Dclassworlds.conf=/c/apache-maven-3.3.9/bin/m2.conf -Dmaven.home=/c/apache-maven-3.3.9 -Dmaven.multiModuleProjectDirectory=/c/controller org.codehaus.plexus.classworlds.launcher.Launcher clean install
  Error: Could not create the Java Virtual Machine.
  Error: A fatal exception has occurred. Program will exit.
  Invalid maximum heap size: -Xmx512m
  </code></pre>