How to Set Java Home

Method 1 of 2:

For Windows

  1. How to Set Java Home Picture 1
    Assuming that the path for the Java Development Kit (JDK) during installation is not changed, it will be in a directory under C:Program FilesJava. This path will have the JDK, let's assume it has jdk1.6.0_06. So the install path is C:Program FilesJavajdk1.6.0_06.
  2. How to Set Java Home Picture 2
    Setting JAVA_HOME using "My Computer":
    1. Right click on the My Computer icon on your desktop and select properties
    2. Click the Advanced Tab
    3. Click the Environment Variables button
    4. Under System Variable, click New
    5. Enter the variable name as JAVA_HOME
    6. Enter the variable value as the install path "C:Program FilesJavajdk1.6.0_06"
    7. Click OK
    8. Click Apply Changes
    9. Restart the computer to make sure the changes are reflected.
  3. How to Set Java Home Picture 3
    Setting JAVA_HOME using command prompt
    1. Open command prompt
    2. Type the following in the command prompt
      set JAVA_HOME = C:Program FilesJavajdk1.6.0_06
      and press enter
      The JAVA_HOME is set.
Method 2 of 2:

For Linux

  1. How to Set Java Home Picture 4
    To set the JAVA_HOME we use .bash_profile which is a start-up script. This particular file is used for commands which runs when the normal user logs in. The steps to set JAVA_HOME are:
    1. Login to your account and open .bash_profile file
      $ vi ~/.bash_profile
    2. If your path is set to /usr/java/jdk1.6.0_06/, set JAVA_HOME as follows:
      export JAVA_HOME=/usr/java/jdk1.6.0_06/
    3. Save and close the file. Logout and login back to see new changes, or type source ~/.bashrc
5 ★ | 1 Vote

May be interested

  • How to Fix JavaPhoto of How to Fix Java
    java is a computing platform that allows you to play games and view videos on your computer. you can tell that your computer is having problems with java if you see java errors appear when you try to run a program or visit a website that...
  • How to Create JAR FilePhoto of How to Create JAR File
    this wikihow teaches you how to create a java compressed folder, also known as a jar file, using a free java program called eclipse. you can do this on both windows and mac computers. make sure that you have the java developer's kit...
  • How to Close a Window in JavaPhoto of How to Close a Window in Java
    this article will show you how to close a window in java. closing a window is much easier using swing's jframe, but it's also doable using awt's frame. obtain an instance of a jframe, or create a new one. set default close operation....
  • How to Compare Two Dates in JavaPhoto of How to Compare Two Dates in Java
    there are various ways to compare java dates. internally, a date is represented as a (long) point in time -- the number of milliseconds that have elapsed since january 1 1970. in java, date is an object, which means it includes multiple...
  • How to Update JavaPhoto of How to Update Java
    this wikihow teaches you how to update java on your computer. although java will usually update itself when possible, you can use java's update feature to force an available update on windows and mac computers. open start . click the...
  • How to Determine Java VersionPhoto of How to Determine Java Version
    multiple copies of java can be installed on a single computer, and, if you have more than one browser, every one of them could be using a different version or none at all. you can determine your java version by verifying it on the java...