Child pages
  • Oracle JDK

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The oracle-java8-set-default package install only those two files. The system will ensure that one those files will be runned when you open a session.

However the Java Environment variables collapse with the /usr/bin and /etc/alternatives system. if we run the java command the PATH is resolved it against /usr/bin. The default jdk.sh or jdk.csh add the path to solve the java command while it is already resolved though the standard update-alternative mechanism. Beyond that it is pretty common to use the JAVA_HOME, the OpenJDK could need it as weel. Not sure who is using the J2SDKDIR and J2REDIR environment variables. Further more Derby is delivered with the Oracle JDK but not with the OpenJDK. It sounds to us that gathering the Java environment variables in a single place is a good practice. Here the jdk.sh and jdsk.csh we use. Basically we remove the extra path information and kept the derby path.

Here is the content of jdk.sh:

Code Block
languagetext
export J2SDKDIR=/usr/lib/jvm/default-java
export J2REDIR=/usr/lib/jvm/default-java/jre
export PATH=$PATH:/usr/lib/jvm/default-java/db/bin
export JAVA_HOME=/usr/lib/jvm/default-java
export DERBY_HOME=/usr/lib/jvm/default-java/db

Here is the content of jdk.csh:

Code Block
languagetext
setenv J2SDKDIR /usr/lib/jvm/default-java
setenv J2REDIR /usr/lib/jvm/default-java/jre
setenv PATH ${PATH}:/usr/lib/jvm/default-java/db/bin
setenv JAVA_HOME /usr/lib/jvm/default-java
setenv DERBY_HOME /usr/lib/jvm/default-java/db

Close and re-open a session and check your environment with a printenv command.

...