Search code examples
javajava-home

Installing JDK and setting JAVA_HOME


  1. What exactly is the purpose of JDK - running java programs or developing?
  2. There seems to be too many packages that include java and jdk/sdk in their title. Which one should I install if I want to develop Java applications?
  3. Who uses JAVA_HOME and what should I set it to be?

Solution

    1. JDK is development environment. JVM is runtime environment.
    2. You should download java installer from oracle web site or install it from repositiry manager
    3. JAVA_HOME system variable usually is required for enterprice java software (application servers, DBs, development tools and so on). You should set JAVA_HOME variable to root directory of JDK or JVM(setting it to JDK always works, but maybe some software will run as expected with JAVA_HOME pointing to JRE). If you set JAVA_HOME right then $JAVA_HOME/bin/java -version command should pring version of java.