title: Unity: JDK stop working
body: <p>I'm building a little android game with Unity 2018.2.2 (last version on 08/08/2018).
  I worked on the game for some weeks but now, without appareantly reason Unity fail when it try to locate my JDK.
  When I assign the folder (edit->preferences->external tools) it fails and show me the next problem: </p>
  
  <p><a href="https://i.stack.imgur.com/mfWAM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mfWAM.png" alt="Error I obtain"></a></p>
  
  <p>[If you can't see the image: "Failed to detect Java version. Android development requires JDK 8 (1.8). Having Java Runatime Environment (JRE) installed is not sufficient."]</p>
  
  <p>The first I think was, may it fails because an JDK's update, so I check if the variable path is ok, and it is.
  Then, I uninstall the jdk and I install again (jdk1.8.0_181). It install normally with 2 folders (jdk1.8.0_181 and jre1.8.0_181) and I update the variable path to "JAVA_HOME  C:\Program Files\Java\jdk1.8.0_181\bin" (in my case).
  But when I try to select this folder in Unity, Unity show me the error of the image. I'm really confuse. Four days ago it works properly. What could be failing??
  This is the log when I try to build the APK and I select the folder of the JDK:</p>
  
  <blockquote>
    <p>UnityException: Build failure!
    Unable to locate Java Development Kit (JDK).
    UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
    UnityEditor.DefaultBuildMethods:BuildPlayer(BuildPlayerOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:170)
    UnityEditor.BuildPlayerWindow:CallBuildMethods(Boolean, BuildOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94)
    UnityEditor.BuildPlayerWindow:GUIBuildButtons(IBuildWindowExtension, Boolean, Boolean, Boolean, BuildPlatform) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:891)
    UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:816)
    UnityEditor.BuildPlayerWindow:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:414)
    System.Reflection.MonoMethod:InternalInvoke(MonoMethod, Object, Object[], Exception&amp;)
    System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    System.Reflection.MethodBase:Invoke(Object, Object[])
    UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:295)
    UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:288)
    UnityEditor.HostView:OldOnGUI() (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:104)
    UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event, Boolean) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:215)
    UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:380)
    UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent(EventBase) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:359)
    UnityEngine.Experimental.UIElements.EventDispatcher:DispatchEvent(EventBase, IPanel) (at C:\buildslave\unity\build\Modules\UIElements\EventDispatcher.cs:260)
    UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:243)
    UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:74)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\IMGUI\GUIUtility.cs:171)
    (Filename:  Line: -1)</p>
  </blockquote>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT:
  Finally I solve the problem.Look at my answer if want more info.</p>