Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio don't know where is Java

I am getting this error:

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

This happens after i remove all JDK (Open and other). Some time before I installed Oracle JDK from official site. So, new folder of JDK named jdk1.7.0.

JAVA_HOME=/usr/lib/jvm/jdk1.7.0  JDK_HOME=/usr/lib/jvm/jdk1.7.0  java version "1.7.0_21"  Java(TM) SE Runtime Environment (build 1.7.0_21-b11)  Java HotSpot(TM) Server VM (build 23.21-b01, mixed mode) 

Android studio starts without any errors. I think that a must rename path to JDK in Android studio? But how?

like image 610
serhiisavruk Avatar asked May 29 '13 21:05

serhiisavruk


People also ask

Where is Java path in Android Studio?

Method #1: For Android Studio Version 4.2 and Above Navigate to File > Project Structure > SDK Location. Upon navigating there you will find that a tab named “JDK Location”, select that and then you can set the JDK path for the current project on which you're working.

How do I find where Java is installed?

Open File Explorer (Win⊞ + R, type explorer, hit Enter), and browse for your Java installation folder. It will likely be installed in either Program Files\Java or Program Files (x86)\Java on your OS drive. Once you find your Java folder, Open to it.

Where is my Java path in Windows?

To make sure that Windows can find the Java compiler and interpreter: Select Start -> Computer -> System Properties -> Advanced system settings -> Environment Variables -> System variables -> PATH.

Does Android Studio automatically install JDK?

Note that installing Android Studio doesn't automatically configure the built-in JDK command line tools. This matters if you want to use the Android SDK command line tools.


1 Answers

All done! I find it in File->Other Settings->Default Project Structure->SDKs. There I change JDK home path.

like image 183
serhiisavruk Avatar answered Oct 03 '22 22:10

serhiisavruk