Child pages
  • Oracle JDK

Versions Compared

Key

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

...

Before installing be sure on what's your plan and your 1 - Java Environment.

Run the following commands in order to install or update the Oracle Java. The idea is applicable to others JVM.

...

The installer takes a while since it needs to download the latest Java installer from the Oracle site.

Then check your 1 - Java Environment. A jinfo should exist populated with your appropriate commands, tools or libraries including a unique priority number.

The Install your new JVM through the update-alternatives mechanism.

...

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 against /usr/bin. The default jdk.sh or jdk.csh add paths to solve the java command commands, tools or libraries 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 well. Not sure who is using the J2SDKDIR and J2REDIR environment variables but we keep it for integrity.

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 is a patched jdk.sh and jdsk.csh we use . Basically who improve the PATH strategy, we favored the /usr/bin and /etc/alternatives style and narrow the PATH strategy. Basically we remove the extra paths and kept the derby path.

Here is the content of of our patched 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 of our patched 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

...

Note: Oracle Java will not work in Google Chrome (since Google changed the plugin implementation system from previous standard) until Oracle issues an updated plugin.

As we see in the the Java Environment Tutorial the .jinfo file is able to register the plugin support. However we do not use this mechanism.

This tutorial only use the Oracle Firefox Java support while Chrome and Chromium do not any more support.

Rather than using the jinfo file to register the plugin support we use the symobic link technics. Do you not forget to update it when upgrading.

...