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

  • What is the difference between Go and Java?What is the difference between Go and Java?
    is golang better than java? is golang harder than java? can golang replace java? this comparison will give you the answer.
  • How to Fix JavaHow 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 Compile a Java ProgramHow to Compile a Java Program
    this wikihow teaches you how to turn your java source code into an executable app using a local and online compiler. if you're using a computer, the most common way to compile java code is using java software development kit (java sdk)...
  • Oracle wants to turn Java EE into fully open sourceOracle wants to turn Java EE into fully open source
    this week, oracle announced plans to move java ee project management to an open source platform, like apache or eclipse.
  • Write and run Java code on the computer for the first timeWrite and run Java code on the computer for the first time
    after you've installed java and set up a path on your computer, you need to know how to run a simple java code on your computer. in this article, we will try to write the first java program, as well as the commands to run this program in cmd.
  • Download Java Runtime Environment 8-build-251Download Java Runtime Environment 8-build-251
    java runtime environment (jre) is a software class that provides the services needed to execute java applications. it is an essential component of the java development kit (jdk) and contains all the tools needed to run various java-based software programs.
  • How to Enable JavaHow to Enable Java
    java is a programming language and platform commonly used in a number of websites and applications. when java is not enabled, you can experience difficulty with viewing or using certain websites and applications. to use java, you must have...
  • 200 common Java interview questions, with reference answers200 common Java interview questions, with reference answers
    if you are going to a java interview, preparing for java programming language questions is necessary. these java interview questions are compiled from tutorialspoint and are accompanied by reference answers.
  • What is the difference between Java and JavaScript?What is the difference between Java and JavaScript?
    although the names of java and javascript seem to be related (javascript seems to be a script in java?), but that's the only similarity. these two languages ​​are not technically related to each other.
  • How to uninstall Java on MacHow to uninstall Java on Mac
    whether you're sick of java's security issues or find it unnecessary, there's a fairly easy way to uninstall java from your mac using java's installer.