Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the reason for the existence of the JAVA_HOME environment variable?

Many java based application requires to set JAVA_HOME env variable. What's the purpose of this variable?

like image 347
user496949 Avatar asked Feb 24 '11 08:02

user496949


People also ask

Where is the JAVA_HOME environment variable?

To set JAVA_HOME, do the following: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.

Is JAVA_HOME system or user variable?

I'd recommend setting it as a system variable. JAVA_HOME is used by Gradle and Maven build tools (and some other things) to know where the root directory of your JDK is located. It should point to the folder where the bin folder is located, ie C:\Program Files\Java\jdk-11.0.

How do you fix error JAVA_HOME is not set and no Java command could be found in your path?

Download Liberica JDK and on installation it will automatically set JAVA_HOME environment variable. Now you just go to Android Studio -> Project Structure -> SDK -> Point all jdk path to liberica jdk installation directory and apply. You are done. Just restart android studio and gradle command will work.


1 Answers

Environment variables are strings that contain information such as drive, path, or file name.

The JAVA_HOME environment variable points to the directory where the Java runtime environment (JRE) is installed on your computer.

like image 166
kamaci Avatar answered Oct 05 '22 23:10

kamaci