I keep getting this error message. “Unable to find suitable jdk installation Please make sure you have a suitable jdk installation.Android development requires at least JDK 6 (1.6)”
I had the same problem, it looks like its either a problem with Unity or the jdk installer.
Either way, here’s how I fixed it on Windows 7 64bit:
Goto the control panel
Open the System item
Click “Advanced system settings” in the left bar
A popup opens
Click the Environment Variables button
A popup opens
In the User variables for USERNAME area click the New… button
8 ) Enter JDK_HOME as Variable name, enter the jdk installation path, in my case **C:\Program Files (x86)\Java\jdk1.7.0_25**, this might be different in your case.
Hit ok
Try doing a build again, it should be working again
OKAY I FIGURED IT OUT (AFTER 4 DAYS). What I did was uninstall the jdk and reinstalled it but this time I READ THE DIRECTIONS ON THIS PAGE. that showed during the installation:
I scrolled down to this part:
================================================== ===============
Updating the PATH Environment Variable (Optional)
You can run the JDK without setting the PATH environment variable, or you can optionally set it so that you can conveniently run the JDK executable files (javac.exe, java.exe, javadoc.exe, and so forth) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable file every time you run it, such as:
C:> “C:\Program Files\Java\jdk1.7.0\bin\javac” MyClass.java
It is useful to set the PATH variable permanently so it will persist after rebooting.
To set the PATH variable permanently, add the full path of the jdk1.7.0\bin directory to the PATH variable. Typically, this full path looks something like C:\Program Files\Java\jdk1.7.0\bin. Set the PATH variable as follows on Microsoft Windows:
Click Start, then Control Panel, then System.
Click Advanced, then Environment Variables.
Add the location of the bin folder of the JDK installation for the PATH variable in System Variables. The following is a typical value for the PATH variable:
OKAY I FIGURED IT OUT (AFTER 4 DAYS). What I did was uninstall the jdk and reinstalled it but this time I READ THE DIRECTIONS ON THIS PAGE. that showed during the installation:
I scrolled down to this part:
================================================== ===============
Updating the PATH Environment Variable (Optional)
You can run the JDK without setting the PATH environment variable, or you can optionally set it so that you can conveniently run the JDK executable files (javac.exe, java.exe, javadoc.exe, and so forth) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable file every time you run it, such as:
C:> “C:\Program Files\Java\jdk1.7.0\bin\javac” MyClass.java
It is useful to set the PATH variable permanently so it will persist after rebooting.
To set the PATH variable permanently, add the full path of the jdk1.7.0\bin directory to the PATH variable. Typically, this full path looks something like C:\Program Files\Java\jdk1.7.0\bin. Set the PATH variable as follows on Microsoft Windows:
Click Start, then Control Panel, then System.
Click Advanced, then Environment Variables.
Add the location of the bin folder of the JDK installation for the PATH variable in System Variables. The following is a typical value for the PATH variable:
This hasn’t resolved the issue for me. I’m on Windows 7 x64. I have tried the following:
Uninstalled all JDKs.
Re-installed 1.7 32 bit, 1.7 x64, 1.6 32 bit, 1.6 x64 one at a time, rebooting in between.
Each time updated JAVA_HOME, JDK_HOME, PATH CLASSPATH to the JDK folder (correctly linking to the root or bin where necessary).
Tried moving out java.exe from System32.
Re-installed Android SDK (r21).
When I installed Unity on Saturday it was working fine, the next day it prompted me to upgrade to Android SDK r22 which I think is when it stopped working, but going back to r21 hasn’t helped.
After spending another 4 hours or so on this I managed to get it working. I noticed in my unity editor log it was throwing an error that it could not access a folder (because it didn’t exist), this folder was completely unrelated to Unity and Java (it was a location of an Havok based android project), so I’ve got no idea why it was trying to access it. Anyway, I created this folder and it was then able to find the JDK.
So if anyone still has this issue then I suggest looking at this log, which can be viewed from the bug log dialog and making sure all errors are resolved, even if they appear unrelated.
I still have this issue and I’m going bonkers over it, I actually gave up untill I saw your post.
Just now I wanted to build and it failed. I try again, without restarting my pc or unity and it just works. Which tells me it not a problem on my setup.
I’ll attach the log to bug report Case 554728 (I did that a week ago or so)
Thank you Lukas!!! That log file explains what is happening.
stderr[
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
]
stdout[
Error occurred during initialization of VM
Could not reserve enough space for object heap
]
As you can see the vm doesn’t even spit out a version number for us to check. We created a fix for this memory issue, but we must have missed the version check. I’ll try to squeeze in a fix asap.
Hi,
i get the same problem. I am not able to build an apk-file, because Unity could not find the JAVA-SDK.
I get exactly the same error log-file. I have tried to reinstall Unity and JAVA SDK. Nothing helps.
I don’t know if there is a workaround but if you try 1 out of 10 builds will succeed. I’m just hoping you don’t have 52 scenes like me and building takes 3minutes