3

I just install Android Studio 1.5 on Ubuntu 14.04. I created a new project and I get the following error:

Error:Could not determine Java version using executable /usr/lib/jvm/java-1.5.0-gcj/bin/java.

My /usr/lib/jvm/ contain:

java-1.5.0-gcj            java-7-oracle  java-gcj
java-1.5.0-gcj-4.8-amd64  java-8-oracle  java-gcj-4.8

The Project Structure has the JDK location set up to /usr/lib/jvm/java-1.5.0-gcj. Should it me something else ? How can I know ?

Many thanks for you help !

Rafnuss
  • 119
  • 1
  • 14

3 Answers3

2

I solved my problem by simply changing the JDK to /usr/lib/jvm/java-8-oracle. I still don't know why it works, or why it should have been like this at the first place. Sorry for the question.

Rafnuss
  • 119
  • 1
  • 14
  • I think the Java executable is executed with -version and the information parsed. And the output of your gcj does not equal what is expected which is based on the strings given by Oracle – Marged Dec 03 '15 at 19:22
1

The problem occurred because location of the JDK directory was not defined correctly. In Android studio File ->Project structure ->in left side tabs click on SDK location->define the directory where JDK is located . For example:/usr/lib/jvm/java-8-oracle/jdk1.8.0_77 is my directory of JDK.The location can be different.

-2

Another variant:

Replace homePath value in ~/.AndroidStudio1.5/config/options/jdk.table.xml on /usr/lib/jvm/java-8-oracle/bin/java

SMR
  • 6,628
  • 2
  • 35
  • 56