【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

时间:2023-03-08 16:44:51

错误描述

在公司电脑上运行Android Studio 2.2已经有一段时间了,但是自己的笔记本上还是用的Android Studio 1.5,今天晚上下了一个Android Studio 2.2压缩包,解压后启动Android Studio 2.2就报错了,错误如下所示:

Unsupported Java Version : Cannot start under Java 1.7.0_04-b22 : Java 1.8 or later is required.

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

分析错误

查看当前电脑的Java Version,如下所示:

C:\Users\Administrator>java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

如上所示,当前电脑的Java JDK版本为1.7.0_04,而Android Studio 2.2 需要Java JDK1.8 以上的版本才能启动。

解决错误

第一步:下载Java JDK1.8

去Oracle官网下载JDK 1.8,地址如下:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

这里我们下载Java SE Development Kit 8u112的Windows x86版本,因为这是笔者当前电脑可以用的JDK版本。

第二步:安装JDK1.8

安装JDK1.8在电脑上,笔者安装在E:\JAVA\JDK_Path\JKD-1.8,如下图所示:

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

第三步:重新配置JAVA_HOME为JDK1.8的安装路径

配置JAVA_HOME的路径为JKD1.8的安装路径E:\JAVA\JDK_Path\JKD-1.8,如下图所示:

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

查看Java Version是否为1.8

C:\Users\Administrator>java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) Client VM (build 25.112-b15, mixed mode)

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

第四步:重新运行Android Studio 2.2 。

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

点击studio.exe,重新运行Android Studio 2.2 ,如下图所示:

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.

OK,把JDK从1.7版本换到1.8版本后重新运行即正常。


作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!

转载请保留原文地址:http://blog.csdn.net/ouyang_peng/article/details/53027992

【我的Android进阶之旅】解决Android Studio启动时报错:Java 1.8 or later is required.