I am running Windows 10. I'm using the GUI installer, glassfish-4.0-windows.exe
. When I reach the screen to select the JDK, it says:
"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."
When I try to type the location manually as "C:\Program Files\Java\jdk-9.0.1", it says:
[]*[{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"
However, at C:\Program Files\Java
, I have:
jdk-9.0.1/
jre-9.0.1/
In environment variables, I have:
Variable: JAVA_HOME
Value: C:\Program Files\Java\jre-9.0.1
And "%JAVA_HOME%\bin"
as the first entry for Path
.
When I check on the command line, java and javac both seem okay:
C:\Windows\System32>javac -version
javac 9.0.1
C:\Windows\System32>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)
This question suggests editing asenv.bat
, but I can't do that pre-installation.
What can/should I do to make Glassfish able to recognize the JDK so I can install it?
edit: GlassFish 4 did not support Java 8 so I decided to try a later version of the program.
I switched to 4.1.1 and tried to install it over the command line.
C:\glassfish>call "%ProgramFiles%\Java\jdk-9.0.1\bin\jar.exe" xf "C:\glassfish\glassfish-4.1.1.zip"
However, when I switched into the new Glassfish4 folder and tried to run asadmin start-domain
, it errored out with GlassFish requires Java SE version 6. Your JDK is version 0
Still having issues locating that JDK.
So, apparently all versions of Glassfish aren't compatible with the 9.0+ JDK as of August 2017.
I downgraded to v8 of the JDK.
The installation GUI alerted an error about not being able to find the JRE initially, and didn't even make it to setting the JDK location.
Running glassfish-4.0-windows.exe -j "C:\Program Files\Java\jdk1.8.0_151\jre"
made Glassfish finally accept it and install successfully.