This Season
 

How to Change Java Home

The JAVA_HOME variable holds the path to your system's Java JDK installation. Java JDK is Sun Microsystem's Java software development kit. Setting the JAVA_HOME variable allows other applications to use the JDK without having to specify where it expects the Java installation to be held. It also allows you to place your Java installation in an unusual place without any program errors. This variable must be set on both Windows and Linux/Unix after installing the Java JDK.

Related Searches:
    Difficulty:
    Easy

    Instructions

    Things You'll Need

    • Java JDK
    1. Windows

      • 1

        Right-click "My Computer" and select "Properties."

      • 2

        Click the "Advanced" tab.

      • 3

        Select "Environment Variables."

      • 4

        Edit JAVA_HOME to point to where the JDK software is located. For example: C:\Program Files\Java\jdk<version>.

        Replace <version> with the version number of the JDK you are using.

      Linux/Unix

      • 1

        Open the ~/.bashrc in a text editor. From the command line, the command would be:
        gedit ~/.bashrc.

      • 2

        Add the following two lines to the 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 JDK you are using. If you have JDK installed in an alternate location, change both variables to reflect your information.

      • 3

        Save your file.

      • 4

        Restart your terminal session.

      • 5

        Type "echo $JAVA_HOME" to ensure the variable has been set correctly.

    Related Searches

    References

    Read Next:

    Comments

    You May Also Like

    • How to Set a Java Path

      Once the Java SDK is installed the path variables must be set so that programs written in Java will be executable from...

    • How to Set the Path for Windows XP Java

      The Java path environment variable is added to Windows, so the operating system can find your Java compiler files. Environment variables in...

    • How to Add Java_Home to Path under Linux

      The JAVA_HOME environment variable is a required configuration item for many programs and compilers that make use of the Java Development Kit...

    • How to Upgrade Java in Linux

      As an Internet browser support system, Java helps allow you to play video games online, view 3D images and perform online chat...

    • How to Change Your Home Page to Yahoo

      Yahoo is a highly influential Web site today, with dozens of features to draw users from around the world. Whether you're at...

    • How to Install Multiple Versions of Java

      Java technology allows programmers to create applications capable of running on nearly any operating system. Instead of writing one version of a...

    • How to Add JAVA_HOME

      JAVA_HOME is a system variable used by Sun Microsystems' Java JDK software development kit. The JDK is responsible for writing and running...

    • How to Set the Time in UNIX

      UNIX is a powerful operating system, but not quite as easy to use as Linux or Windows. If you need to set...

    • How to Set Focus in Java

      The "requestFocus" function in Java lets you programmatically set focus to any element in a Java program window. Instead of requiring the...

    Follow eHow

    Related Ads