Cannot start under Java 1.7.0_101-b00: Java 1.8 or later is required. After updating to Android Studio v2.2.0 (September 2016)

I updated android studio to version 2.2.0. It is not going to restart again, it asks "Cannot start under Java 1.7.0_101-b00: Java 1.8 or later is required."

I am using jdk 8.

echo $ JAVA_HOME

/ USR / Library / JVM / Java-8-oracle

enter image description here

+5
source share
7 answers

I had the same problem on an Ubuntu system. In my case, the problem was solved in a few steps:

  • Delete old android studio

  • Install java 8

[Commands for installing java 8]

$ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer 

[Check installed java]

 $ java -version $ javac -version 

[Command to install java 8 by default]

 $ sudo apt-get install oracle-java8-set-default 
  1. Remove old java versions from [root] / usr / lib / jvm location

[In my case for java version 7]

 rm -r java-7-oracle 
  1. Restart your computer

  2. Install Android Studio as indicated in https://developer.android.com/studio/install.html

+4
source

The following steps solved the problem for me (Android Studio runs on Windows Vista):

  • Update Java JDK to version 1.8. Download link
  • Update JAVA_HOME environment variable: go to Start> Computer> System Properties> Advanced System Properties. Then go to the Advanced tab> Environment Variables. Select JAVA_HOME (or create one if missing), and Edit to specify a new JDK folder ( here is a good tutorial ).

Now you can enjoy Android Studio.

+3
source

If you are running Windows and experiencing this, make sure you run the studio executable that matches the bit level of your jdk installation.

So, if you have installed 64-bit JDK (what you need), then be sure to run studio64.exe

+1
source
  • Install java-8 (open JDK or Oracle JDK)

  • Update JAVA_HOME environment variable (specify java-8)

  • Removing the Android Studio shortcut from the desktop

  • Launch Android Studio from cmd (by executing "the path to the Android studio folder" / android -studio / bin / studio.sh)

  • This will launch Android Studio. You can re-create a shortcut from Android Studio-> Tools-> Create desktop entry ...

+1
source

Adding the JDK_HOME system variable with a value of c: \ Program Files \ Java \ jdk-xxxxx \ worked for me. The latest version of Java can be downloaded here.

Also, make sure the JAVA_HOME variable is also set to the location above.

0
source

The problem was the task of starting the desktop. originally it was

 [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Name=AndroidStudioWorkSpace - [~/AndroidStudioWorkSpace] - Android Studio 2.2 Icon=jetbrains-studio Path=/home/nilesh/Drive/Software/android-studio/bin Exec=/usr/lib/jvm/java-7-openjdk-amd64/bin/java -Xbootclasspath/a:./../lib/boot.jar -classpath ./../lib/bootstrap.jar:./../lib/extensions.jar:./../lib/util.jar:./../lib/jdom.jar:./../lib/log4j.jar:./../lib/trove4j.jar:./../lib/jna.jar:/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar -Xms256m -Xmx1280m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -da -Djna.nosys=true -Djna.boot.library.path= -Djna.debug_load=true -Djna.debug_load.jna=true -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Dawt.useSystemAAFontSettings=lcd -Djb.vmOptionsFile=./studio64.vmoptions -XX:ErrorFile=/home/nilesh/java_error_in_STUDIO_%p.log -XX:HeapDumpPath=/home/nilesh/java_error_in_STUDIO.hprof -Djb.restart.code=88 -Didea.paths.selector=AndroidStudio2.2 -Didea.platform.prefix=AndroidStudio -Didea.jre.check=true com.intellij.idea.Main StartupNotify=false StartupWMClass=jetbrains-studio OnlyShowIn=Unity; X-UnityGenerated=true ~ 

I changed it to

 [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Name=AndroidStudioWorkSpace - [~/AndroidStudioWorkSpace] - Android Studio 2.2 Icon=jetbrains-studio Path=/home/nilesh/Drive/Software/android-studio/bin Exec=/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xbootclasspath/a:./../lib/boot.jar -classpath ./../lib/bootstrap.jar:./../lib/extensions.jar:./../lib/util.jar:./../lib/jdom.jar:./../lib/log4j.jar:./../lib/trove4j.jar:./../lib/jna.jar:/usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar -Xms256m -Xmx1280m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -da -Djna.nosys=true -Djna.boot.library.path= -Djna.debug_load=true -Djna.debug_load.jna=true -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Dawt.useSystemAAFontSettings=lcd -Djb.vmOptionsFile=./studio64.vmoptions -XX:ErrorFile=/home/nilesh/java_error_in_STUDIO_%p.log -XX:HeapDumpPath=/home/nilesh/java_error_in_STUDIO.hprof -Djb.restart.code=88 -Didea.paths.selector=AndroidStudio2.2 -Didea.platform.prefix=AndroidStudio -Didea.jre.check=true com.intellij.idea.Main StartupNotify=false StartupWMClass=jetbrains-studio OnlyShowIn=Unity; X-UnityGenerated=true ~ 

I replaced the task of starting the desktop with java 8

0
source

Summary: Check ~ / .profile (and not ~ / .bashrc) to set the environment variable pointing to the jdk 1.8 folder.

I got such a problem when I upgrade Android Studio from version 2.1 to version 2.2 under Ubuntu.

You can check studio.sh in the Android Studio installation folder to find out how it checks the Java version. It says: Find the JDK installation directory that will be used to start the IDE. Try (in order): STUDIO_JDK, .. / jre, JDK_HOME, JAVA_HOME, "java" in PATH.

Shebang in studio.sh: #! / Bin / sh You can check if any of the environment variables $ STUDIO_JDK, $ IDE_HOME, $ JDK_HOME, $ JAVA_HOME are found in the file ~ / .profile (and not ~ / .bashrc) previous version of Java.

In my case, I pointed $ JAVA_HOME to the Java 1.7 site. After changing $ JAVA_HOME to a Java 1.8 location, I could start Android Studio again.

Remind me . To reload the ~ / .profile file, it needs to log out and log in.

0
source

All Articles