1

I had installed OpenJDK7 in my machine for Java programming. Then I removed it and installed Oracle 1.7Jdk. But the problem is Android Studio isn't taking the new JDK. It gives the following error:

Cannot run program "/usr/lib/jvm/java-7-openjdk-i386/bin/java" (in directory "/home/pranay/.AndroidStudioPreview/system/compile-server"): error=2, No such file or directory

How can I run Android Studio?

Prazzy Kumar
  • 994
  • 1
  • 11
  • 16
  • What OS are you using? And just to be clear, are you seeing this error on the command line when you try running Android Studio? – oakes May 24 '13 at 18:16

3 Answers3

9

Android-Studio may stores the location of Java in $HOME/.AndroidStudioPreview/config/options/jdk.table.xml

Delete this file and restart Android-Studio, it should now prompt you for your new Java location.

Cheers

HPP
  • 1,074
  • 1
  • 13
  • 28
2

Seems that Android Studio can't find your JDK, probably your system installed it on a different location (and not in "/usr/lib/jvm/java-7-openjdk-i386/bin/java"). I had another problem with Java and Android Studio, but I think the soulution could also work for you. IntelliJ needs a fixed installation of the JDK in one of these locations (found it here):

/usr/java

/opt/java

/usr/lib/jvm

My JDK was in another folder, so I moved it to /usr/java and now it works fine :)

Julia Hexen
  • 695
  • 3
  • 10
1

The location is now:

~/.AndroidStudio/config/options

not

~/.AndroidStudioPreview/config/options

since AS has been officially released.