eHow launches Android app: Get the best of eHow on the go.

How To

How to Add JAVA_HOME

Contributor
By Kristen Leigh Grubb
eHow Contributing Writer
(0 Ratings)

JAVA_HOME is a system variable used by Sun Microsystems' Java JDK software development kit. The JDK is responsible for writing and running Java applications. The JAVA_HOME variable allows applications to find the JDK without having to specify the exact path for every system. It also allows you to install the JDK software in a non-default location. It must be added to the Operating System's system variables after the JDK is installed.

Difficulty: Easy
Instructions

Things You'll Need:

  • Java JDK

    Windows

  1. Step 1

    Click on "Properties" under "My Computer."

  2. Step 2

    Select the "Advanced" tab.

  3. Step 3

    Click on "Environmental Variables."

  4. Step 4

    Type the path to the Java JDK folder next to "JAVA_HOME". The default location is "C:\Program Files\Java|jdk<version>." Replace <version> with the version number of the installed JDK.

  5. Linux/Unix

  6. Step 1

    Open the file "~/.bashrc" in any text editor.

  7. Step 2

    Add the following two lines to the ".bashrc" file:
    export JAVA_HOME=/usr/java/jdk<version>/bin/java
    export PATH=$PATH:/usr/java/jdk<version>/bin
    Replace <version> with the version number of the installed JDK.

  8. Step 3

    Save and close the file.

  9. Step 4

    Open a terminal window. The terminal window will be found in the operating system's main "Application" menu, under either "System Tools" or "Utilities". You will be presented with a command prompt.

  10. Step 5

    Type "echo $JAVA_HOME" (no quotes) to test your configuration.

Tips & Warnings
  • If you installed the JDK in a non-default location, specify the new location when defining the variable.
Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Tags
Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

eHow Computers
eHow_eHow Technology and Electronics