Cannot use Server JRE: The selected directory is not a valid home for JDK
Answered
I followed the suggestion from this SO post (https://stackoverflow.com/questions/10891405/installing-jdk-without-administrator-privileges) and installed the Server JRE on a Windows machine where I don't have Admin privileges. However, IntelliJ would't allow me to add these as JDKs, complaining "The selected directory is not a valid home for JDK". I don't need the missing functionality in Server JRE (https://blogs.oracle.com/java-platform-group/understanding-the-server-jre) and will really like to be able to use newer versions of JDK that I can install myself. Thanks!
Please sign in to leave a comment.
You need to have the standard JDK installation from Oracle, IntelliJ IDEA will not accept anything having different directories/files layout.
You could try using JetBrains Runtime download from Bintray, just download and unpack it: https://intellij-support.jetbrains.com/hc/articles/206544879.
Thanks for your reply. It's good to know about the Bintray download option.
I just wanted to add that the server JDK, which is provided by Oracle itself, does have more or less the same directories/files layout. It appears to be missing only JavaFX and DB. Please see the the screenshots below.
Full:
Server:
,
It's also missing src.jar which is very handy to see sources/JavaDoc of the classes you are using from the JDK.
Dear Serge,
I have very same situation as Peng: wanna use windows Server JRE from Oracle:
http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/server-jre-8u161-windows-x64.tar.gz
The option given from Bintray is not totally clear: is there any jdk there similar to the one above?
Thanks.
You need JDK, not JRE. Why can't you use the standard JDK?
Hi Serge,
While the version I wanna use is advertised as "Server JRE", the unpacked directory is named as "jdk1.8.0_161"; and the directory structure has javac and stuff.
I wanna test some optimizations for this server-side JRE, as my client version does not seem to perform as expected (ultimate reason may be different, but need to discard this reason).
Please kindly advise how to wire this JDK/JRE with my project.
Thanks.
I have no problem adding the server JRE in IntelliJ IDEA:
Please try File | Invalidate Caches | Invalidate and Restart.
I tried that trick but did not work.
I also downloaded the same version you used (a bit newer than mine), but result is the same.
May I know what version you used? Mine is
IntelliJ IDEA 2017.3.1 (Community Edition)
Build #IC-173.3942.27, built on December 11, 2017
JRE: 1.8.0_152-release-1024-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Thanks.
2017.3.4 from http://www.jetbrains.com/idea/download/index.html.
That was it. After upgrading to latest version I can add the Server JRE as SDK, just like you did.
Thanks Serge