title: Error: Could not find or load main class –Xmx1G
body: <p>This is crazy; has anyone ever seen this before?</p>
  
  <pre><code>java –Xmx1G –Xms1G –XX:+UseG1GC -XX:+PerfDisableSharedMem -jar service-1.0-SNAPSHOT.jar
  Error: Could not find or load main class –Xmx1G
  </code></pre>
  
  <p>I can do this:</p>
  
  <pre><code>java -jar service-1.0-SNAPSHOT.jar –Xmx1G –Xms1G –XX:+UseG1GC -XX:+PerfDisableSharedMem
  </code></pre>
  
  <p>but <code>jmap -heap {PID}</code> shows that it's ignoring the options completely.  I've tried different variations:</p>
  
  <pre><code>java –XX:+UseG1GC -jar service-1.0-SNAPSHOT.jar –Xmx1G –Xms1G  -XX:+PerfDisableSharedMem
  java -Xms1G -Xmx1G -jar service-1.0-SNAPSHOT.jar
  java –xx:+useg1gc -jar service-1.0-SNAPSHOT.jar
  java -server –XX::+UseG1GC -jar service-1.0-SNAPSHOT.jar`
  </code></pre>
  
  <p>I either get this error:
  <code>Error: Could not find or load main class {OPTION}</code></p>
  
  <p>Or it runs but ignores options.</p>
  
  <p>Even <code>java -XX:-UseConcMarkSweepGC -jar service-1.0-SNAPSHOT.jar</code> is ignored:</p>
  
  <pre><code>jmap -heap 5879 
  Attaching to process ID 5879, please wait... 
  Debugger attached successfully. 
  Server compiler detected. 
  JVM version is 25.121-b13
  
  using thread-local object allocation.  
  Parallel GC with 8 thread(s)  
  Heap Configuration:
  
  MinHeapFreeRatio         = 0
  MaxHeapFreeRatio         = 100
  MaxHeapSize              = 4294967296 (4096.0MB)
  NewSize                  = 89128960 (85.0MB)
  MaxNewSize               = 1431306240 (1365.0MB)
  OldSize                  = 179306496 (171.0MB)
  NewRatio                 = 2
  SurvivorRatio            = 8
  MetaspaceSize            = 21807104 (20.796875MB)
  CompressedClassSpaceSize = 1073741824 (1024.0MB)
  MaxMetaspaceSize         = 17592186044415 MB
  G1HeapRegionSize         = 0 (0.0MB)
  </code></pre>
  
  <p>This is my JVM:</p>
  
  <pre><code>java -version
  java version "1.8.0_121"
  Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
  Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
  </code></pre>
  
  <p>This is happening on my Mac, and in Alpine Docker image.  Any thoughts?</p>