- Home /
The path you specified does not look like a valid JDK installation
Hi all, Im tearing my hair out with this one. One day Im happily producing android builds, the next Im getting an error asking me to point to a valid JDK directory. I've wasted half a night trying to get it working again to no avail. I've tried adding the jdk path to the environment variable,restarted the pc etc,updated the jdk and nothing works. Can anyone please help???????????????????????????????????? EDIT: Im running 64bit. I tried both 64bit and x86 jdks. No luck
Answer by 3ddave · Sep 01, 2016 at 12:48 AM
You haven't provided many details about your configuration so I'll try to cover all the bases here. The path that will "look like" a valid JDK installation is as follows: jdk_1.8 <-- Point to this folder | bin | javaw.exe | javac.exe | include | jre | bin | javaw.exe | lib | lib When you find where to input the path it should be the top level jdk folder (not bin or jre).
There are several levels of "resolution" that are used to find the java installation, going from most specific to least specific (which is the search order) they are typically:
Application
User
System
Typically an application will allow you to specify the path directly in a settings menu, however some require you to specify the path before the application is started, either via configuration or system level path (you didn't specify what program you are using).
User and System will both roll up under "Environment" variables for windows (again, you didn't specify what operating system you are using). User environment variables will typically override what is set for the system variables of the same name. Typically, the Java installation will set the System level environment variables. Currently I have the following vars set which seem to work for most apps:
JAVA_HOME C:\Java\jdk_1.8.0_102\jre
JDK_HOME C:\Java\jdk_1.8.0_102
JRE_HOME C:\Java\jdk_1.8.0_102\jre -PATH %JAVA_HOME%;%JAVA_HOME%\bin;%JDK_HOME%;%JDK_HOME%\bin etc etc
Having the path include JAVA_HOME and JDK_HOME may be important for some applications to work correctly (note that I include both JAVA_HOME and JAVA_HOME\bin so I can access both folders directly). My JAVA_HOME does indeed point to the JRE, but I suspect pointing to the JDK would also work. Sometimes you need to swap the paths around before they work correctly for your target application.
You may need to restart after updating your environment before it fully takes effect. If you are installing a new version of Java, I would recommend you try to ensure no older unwanted versions are still installed. Make sure the version you do have installed is compatible with the application you are using. If you have auto-update enabled, Java may have updated behind the scenes without you knowing it.
Apologies for the lack of detail but I was frothing at the mouth in anger :D I'm on Windows 10 64bit and the latest Unity (5.point something). Ah I was setting user level environment variables. $$anonymous$$aybe that was my issue. Cheers, Ill compare my env vars to yours and see how it looks!
Also note that, for whatever reason, you have to restart your PC for java path updates to be taken into account by Unity.
I had my JAVA_HO$$anonymous$$E variable set to jdk\bin, and that's where Unity was looking for it. After realizing the mistake and changing JAVA_HO$$anonymous$$E just to the jdk root directory, Unity was still looking at jdk\bin. After restarting, everything worked fine. This was painful.