Search code examples
javacentosenvironment-variablessubversion-edge

JAVA_HOME environment variable and installed Java in CentOS


I am installing SUbversion Edge under CentOS 7.

The first step is

  Set the JAVA_HOME environment variable, and point it to your Java 6 JRE
  home.  For example:

  export JAVA_HOME=/usr/java/default

  Test the variable:

  $ $JAVA_HOME/bin/java -version
  java version "1.6.0_20"
  Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
  Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

The problem is that /usr/java forlder not exists.

But /usr/bin/java is existing.

Have I use this folder instead? So what do I have to do?


Solution

  • You should use correct Java home path in your system. If you installed Java in CentOS via YUM, then correct path should be

    export JAVA_HOME=/usr/lib/jvm/jre

    You should not use /usr/bin/java as JAVA_HOME, because it is not Java home path, it is symlink to java executable.