How to install Java Home

Table of contents:

How to install Java Home
How to install Java Home
Anonim

Do you want to install Java Home? The Java Home variable is typically written like this: JAVA_HOME, and is installed in the Java folder.

Steps

Method 1 of 2: Windows

Set Java Home Step 1
Set Java Home Step 1

Step 1. Suppose the Java Development Kit (JDK) is installed in the default folder, namely C:\ Program Files \ Java. This folder contains the JDK, for example version jdk1.6.0_06. Thus, the folder of interest to us is: C: \ Program Files \ Java \ jdk1.5.0_08.

Set Java Home Step 2
Set Java Home Step 2

Step 2. Install JAVA_HOME using My Computer

  1. Right-click on the My Computer icon (on the desktop) and select Properties from the menu.
  2. Click on the "Advanced" tab.
  3. Click on Environment Variables.
  4. Under the System Variables section, click New.
  5. In the Variable Name field, enter JAVA_HOME.
  6. In the Variable Value field, enter C: \ Program Files \ Java \ jdk1.6.0_06.
  7. Click OK.
  8. Click OK again.
  9. Restart your computer for the changes to take effect.
  10. Set Java Home Step 3
    Set Java Home Step 3

    Step 3. Install JAVA_HOME using the command line

    1. Open command prompt
    2. At the command prompt, enter

      set JAVA_HOME = C: \ Program Files \ Java \ jdk1.6.0_06

      and press Enter. JAVA_HOME is installed.

      Method 2 of 2: Linux

      Set Java Home Step 4
      Set Java Home Step 4

      Step 1. To set JAVA_HOME use.bash_profile, which is the startup script (runs commands when the user logs in)

      To install JAVA_HOME do the following:

      1. Login to your account and open the.bash_profile file

        $ vi ~ /.bash_profile

      2. If the path to the Java folder is /usr/java/jdk1.6.0_06/bin/java, then set JAVA_HOME as follows:

        export JAVA_HOME = / usr / java / jdk1.6.0_06 / bin / java

      3. Save and close the file. Restart your computer for the changes to take effect.

        Advice

        • To check for the presence of JAVA_HOME on Windows, type

          C: \> echo% JAVA_HOME%

          The following message will be displayed:

          C: \ Program Files \ Java \ jdk1.6.0_24

        • To check for the presence of JAVA_HOME on Linux, type

          $ echo $ JAVA_HOME

        • On Linux,.bash_profile runs Bash shell commands and.bashrc runs new Bash shell commands. When editing.bash_profile, you are setting JAVA_HOME for one user; to do this for all users, edit the global settings in / etc / profile or /etc/bash.bashrc.

Popular by topic