简体   繁体   中英

Android Studio doesn't recognize JDK

My Android Studio suddenly stopped recognizing JDK. it starts fine with no error messages. I have JDK 1,7 (x86 version) on windows 8.1. Environment variable is defined in the system variables and I can run java -version command from cmd with no issue. following screen shot describe the problem clearly:在此处输入图片说明

You may need to check if both JDK and SDK are set correctly.

In the current project :

  • Go to File > Project Structure..
  • Explore the sections " Android SDK Location " and " JDK Location " (Put the complete paths)
  • Click OK to save changes

For projects default :

  • Close current Project (File > Close project)
  • Click on Configure > Project Defaults > Project Structure
  • Explore the sections " Android SDK Location " and " JDK Location " (Put the complete paths)
  • Click OK to save changes

Restart Android Studio and try again.

Screenshot: http://i.imgur.com/0OD8OeJ.png (I cannot post images directly)

After spending one night trying to solve this problem, i just did as suggested by yole

So Simple : File ----> Invalidate.

I had the same problem after upgrading to build tool 22.0.1. I solved this issue by removing dependencies and adding it again like app-compact and play services.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM