GlassFish 4 error starting domain domain1 listening for transport dt_socket at address: 9009 Error: could not find or load main class files
<p>I am trying to run GlassFish4 on Windows 7. At <code>glassfish4\bin</code> I run <code>asadmin start-domain -d</code> and I get the following error message:</p>

<blockquote>
  <p>Waiting for domain 1 to start. Error starting domain domain1. The
  server exited prematurely with exit code 1.</p>
  
  <p>Before it died, it produced the following output:</p>
  
  <p>Listening for transport dt_socket at address: 9009 Error: could not
  find or load main class files.</p>
  
  <p>Command start-domain failed</p>
</blockquote>

<p>I checked the <code>PATH</code> and <code>CLASSPATH</code> and things appear to be ok but obviously something is wrong here.</p>