title: Glassfish Server 4.0 (now: 4.1.1) installation: can't find the JDK and won't accept a manual location
body: <p>I am running Windows 10. I'm using the GUI installer, <code>glassfish-4.0-windows.exe</code>. When I reach the screen to select the JDK, it says:</p>
  
  <pre><code>"No valid JDKs or JREs were detected on the system, and no JDK is included in this installer. You must specify a path to a custom JDK or JRE."
  </code></pre>
  
  <p>When I try to type the location manually as "C:\Program Files\Java\jdk-9.0.1", it says:</p>
  
  <pre><code>[]*[{0} {1}]: Invalid or incompatible Java directory. Please specify the path to a valid Java directory. Directory=C:\Program Files\Java\jdk-9.0.1"
  </code></pre>
  
  <p>However, at <code>C:\Program Files\Java</code>, I have:</p>
  
  <pre><code>jdk-9.0.1/
  jre-9.0.1/
  </code></pre>
  
  <p>In environment variables, I have:</p>
  
  <pre><code>Variable: JAVA_HOME
  Value: C:\Program Files\Java\jre-9.0.1
  </code></pre>
  
  <p>And <code>"%JAVA_HOME%\bin"</code> as the first entry for <code>Path</code>.</p>
  
  <p>When I check on the command line, java and javac both seem okay:</p>
  
  <pre><code>C:\Windows\System32&gt;javac -version
  javac 9.0.1
  
  C:\Windows\System32&gt;java -version
  java version "9.0.1"
  Java(TM) SE Runtime Environment (build 9.0.1+11)
  Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/10444959/how-do-i-specify-the-jdk-for-a-glassfish-domain?rq=1">This question</a> suggests editing <code>asenv.bat</code>, but I can't do that pre-installation.</p>
  
  <p>What can/should I do to make Glassfish able to recognize the JDK so I can install it?</p>
  
  <p>edit: <a href="https://stackoverflow.com/questions/24064797/glassfish-server-jdk-jre-issue?rq=1">GlassFish 4 did not support Java 8</a> so I decided to try a later version of the program.</p>
  
  <p>I switched to 4.1.1 and tried to install it over the command line.</p>
  
  <pre><code>C:\glassfish&gt;call "%ProgramFiles%\Java\jdk-9.0.1\bin\jar.exe" xf "C:\glassfish\glassfish-4.1.1.zip"
  </code></pre>
  
  <p>However, when I switched into the new Glassfish4 folder and tried to run <code>asadmin start-domain</code>, it errored out with <code>GlassFish requires Java SE version 6.  Your JDK is version 0</code></p>
  
  <p>Still having issues locating that JDK.</p>