title: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
body: <p>I'm using Eclipse to run java program class, while I run it i got this error</p>
  
  <pre><code>Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
  </code></pre>
  
  <p>then i changed the VM from the Properties > Run > VM Options, and I run the program again i got a new error,</p>
  
  <pre><code>Error occurred during initialization of VM
  Incompatible initial and maximum heap sizes specified
  </code></pre>
  
  <p>I'm trying to apply stanford libraries in my program, any idea how to solve this error .</p>