Android Studio JDK location changes back to 1.7 every time it is updated to 1.8 path

后端 未结 6 1855
傲寒
傲寒 2020-12-03 21:23

I recently installed jdk 1.8 u92 after Android Studio said it is needed for api24 builds. However, I\'ve run into this issue now.

I looked at some other solutions an

6条回答
  •  一整个雨季
    2020-12-03 21:39

    follow these steps:(the steps are for windows; reach the same directories in case of other operating systems)

    Step 1: Press "Win + R", type in "%userprofile%" and press enter.

    Step 2: Go to the Android Studio folder which will be in the following format - ".AndroidStudio2.2" (the version may vary)

    Step 3: Go to the "config\options" folder.

    Step 4: Make a copy of jdk.table.xml at desktop and Delete jdk.table.xml . (Do it while the android studio is still running)

    Step 5: In android Studio -Go to "File-> Project Structure" and select the correct jdk path.

    IF STEP 4 and STEP 5 do not solve the problem, follow these steps::

    Step 4': Open jdk.table.xml in notepad.

    Step 5': Find all the words including jdk version - for eg. find "1.8.0_45"

    Step 6': Replace the words found; with your current jdk version . For eg. change "1.8.0_45" to "1.8.0_111" (make sure you replace all the fields containing the version number)

    Step 7': Save the jdk.table.xml file

    Step 8': Restart android studio.

    This will definitely solve the issue.

    PS: JDK should be installed and the path should be set.

提交回复
热议问题