Android Studo showing :"OpenJDK shows intermittent performance and UI issues."

Solution 1:

I don't have an exact solution, but I figure I share my experience since finding this question helped me resolve my issue. I was just having the same issue as you with Linux Mint 17 x64, also using JDK 8u20, and stumbled upon your post, which led me to the blog post you linked in your post. Following those steps resolved my issue without having to make any changes to Android Studio. I just executed the commands, restarted Android Studio and the notification was gone.

My only suggestion I could say is to make sure you're getting the commands correctly and when doing the two commands

sudo update-alternatives --config java 

sudo update-alternatives --config javaws

that you ensure you're selecting the correct number selection ID to the newer JDK

/usr/lib/jvm/jdk1.8.0_20/bin/java

My selections were 2 and 3, respectively, for those two commands.

Hope that helps narrow a solution down for you. Thanks for helping me, I hope that helps you narrow down a solution. Good luck.

Solution 2:

I'm using Linux Mint as opposed to Ubuntu, but this information might be relevant

One way or another, you are probably launching Android Studio via the bin/studio.sh shell script. If you open that file in a text editor, you'll see how the following section where the JDK is loaded.

 ---------------------------------------------------------------------
# Locate a JDK installation directory which will be used to run the IDE.
# Try (in order): STUDIO_JDK, JDK_HOME, JAVA_HOME, "java" in PATH.
# ---------------------------------------------------------------------
if [ -n "$STUDIO_JDK" -a -x "$STUDIO_JDK/bin/java" ]; then
  JDK="$STUDIO_JDK"
elif [ -n "$JDK_HOME" -a -x "$JDK_HOME/bin/java" ]; then
  JDK="$JDK_HOME"
elif [ -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
  JDK="$JAVA_HOME"
else
  JAVA_BIN_PATH=`which java`
...

In my case, I had the $JAVA_HOME defined in my .bashrc file pointing to my OpenJDK location (probably when I first installed Eclipse or some other software that had instructions on setting a global java location environment variable).

# JAVA HOME
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin

Since the studio.sh script looks for the environment variable $STUDIO_JDK first, you can simply install Oracle's JDK and define a STUDIO_JDK environment variable in your .bash_profile or .bashrc to point to this installation. I have not yet done so myself, so I will edit this if I run into any issues when I do.