java Android Studio 设置 JDK 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35578036/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 00:19:00  来源:igfitidea点击:

Android Studio setup JDK error

javaandroidandroid-studiojdk1.8-73

提问by Jaiprakash Soni

In Android Studio I am facing bellow error enter image description here

在 Android Studio 中,我面临以下错误 在此处输入图片说明

This popup shows when I press Alt+Enterfor missing classes(symbols). When I click on setup SDK it shows two options

当我按下Alt+Enter缺少的类(符号)时,会显示此弹出窗口。当我点击 setup SDK 时,它会显示两个选项

  1. 1.8(Java version "1.8.0_60")
  2. Android API 23 Platform (Java version "1.8.0_60")
  1. 1.8(Java 版本“1.8.0_60”)
  2. Android API 23 平台(Java 版本“1.8.0_60”)

Nothing happens on selecting any of above options.

选择上述任何选项时没有任何反应。

NOTE:My Java_Home path is correct and in android studio I have checked JDK path it's correct.

注意:我的 Java_Home 路径是正确的,在 android studio 中我检查了 JDK 路径是正确的。

I am using Android Studio 1.5.0, Java 1.8 and windows 10

我使用的是 Android Studio 1.5.0、Java 1.8 和 Windows 10

回答by Jaiprakash Soni

Simple Invalidate Cache and Restartdoesn't work for me. So I have done following steps:

简单Invalidate Cache and Restart对我不起作用。所以我做了以下步骤:

  1. Check and verify Java path in Java_home variable
  2. Start Android Studio and invalidate cache File--> Invalidate Cache and Restart
  1. 检查并验证 Java_home 变量中的 Java 路径
  2. 启动 Android Studio 并使缓存失效 File--> Invalidate Cache and Restart

回答by Attaullah Attari

Start Android Studio and click File -> Invalidate Cache and Restart.This has worked for me. Thanks

启动 Android Studio 并点击File -> Invalidate Cache and Restart。这对我有用。谢谢

回答by Hanisha

Close Android studio then again open it . Go to File--> Invalidate Cache and Restart . You are done.

关闭 Android studio 然后再次打开它。转到 File--> Invalidate Cache and Restart 。你完成了。