3

Where should JAVA_HOME be pointing to - JDK or JRE? I have seen that in few websites. It is set to JRE and in others it is to JDK. And is it dependant on Java version in any way?

Unihedron
  • 10,902
  • 13
  • 62
  • 72
Anveshan
  • 614
  • 1
  • 9
  • 21

3 Answers3

2

JDK stands for Java Development Kit, while JRE stands for Java Runtime Environment. JAVA_HOME should point to a JDK not a JRE as the JDK is used for development purposes. JDK includes the compiler and other tools needed to develop Java applications while JRE does not.

See How to set java_home on Windows 7? on how to change your JAVA_HOME.

Source: Java SE 6 vs. JRE 1.6 vs. JDK 1.6 - What do these mean?

cb4
  • 6,689
  • 7
  • 45
  • 57
ktzhang
  • 4,069
  • 2
  • 19
  • 18
1

You should set JAVA_HOME to the JDK.

Relevant Documentation:

  1. Install the JDK software.

    a. Go to http://java.sun.com/javase/downloads/index.jsp.

    b. Select the appropriate JDK software and click Download.

    The JDK software is installed on your computer, for example, at C:\Program Files\Java\jdk1.6.0_02. You can move the JDK software to another location if desired.

  2. To set JAVA_HOME:

    a. Right click My Computer and select Properties.

    b. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.6.0_02.

jh314
  • 27,144
  • 16
  • 62
  • 82
0

1-Right click desktop ->Show More Options ->Personelize->System-->About-->Advanced System Setting-->Environment variables-->

user variables ... JAVA_HOME C:\Program Files\java\jdk-19 --> ok CLİCK

System variables ... Path ->New -> C:\Program Files\java\jdk-19 \bin