There appears to be several items that need to be performed to properly install Oracle Java.
Where to install
(I read several conflicting places Oracle Java should be installed)
The IBM version that comes as the installed Java is installed at:
IBM Java has:
l /usr/lib64/jvm-private/java-1_6_0-ibm
Which only has:
drwxr-xr-x 3 root root 4096 Mar 12 10:45 jce/
Appears the binaries are:
l /usr/lib64/jvm/jre-1.6.0-ibm/
drwxr-xr-x 4 root root 4096 Mar 21 11:18 bin/
drwxr-xr-x 2 root root 4096 Mar 21 11:18 javaws/
drwxr-xr-x 18 root root 4096 Mar 21 11:18 lib/
-rwxr-xr-x 1 root root 1191000 Mar 12 10:46 .qa_filelist.x86_64*
drwxr-xr-x 2 root root 4096 Mar 12 10:46 .systemPrefs/
When you install Oracle Java from the Binary, it installs to:
l /usr/java/
drwxr-xr-x 8 root root 4096 Mar 22 12:38 jdk1.7.0_17/
drwxr-xr-x 6 root root 4096 Mar 21 11:10 jre1.7.0_17/
(I installed both the JDK and JRE and do realizes I only need the JDK)
I also found there are pointers to is here: (All empty directories so I think useless! whihc were apparenlty form time stamps in the original install)
l /usr/lib64/ |grep java
drwxr-xr-x 2 root root 4096 Feb 20 2009 java/
drwxr-xr-x 2 root root 4096 Feb 20 2009 java-1.4.0/
drwxr-xr-x 2 root root 4096 Feb 20 2009 java-1.4.1/
drwxr-xr-x 2 root root 4096 Feb 20 2009 java-1.4.2/
drwxr-xr-x 2 root root 4096 Feb 20 2009 java-1.5.0/
drwxr-xr-x 2 root root 4096 Feb 20 2009 java-1.6.0/
drwxr-xr-x 2 root root 4096 Feb 20 2009 java-1.7.0/
drwxr-xr-x 2 root root 4096 Feb 20 2009 java-ext/
The alternatives MESS!
I understand and appreciate the idea of alternatives however it is a mess.
The documentation is non-existent. As a simple example, which is the higer priority: 1610 or 60? (Would you rather be first or 1610?)
Anyhow, here is what, after reading a lot of conflicting entries:
Instaled the Oracle Java using:
zypper in jre-7u7-linux-x64.rpm -y
Set a softlink as:
ln -s /usr/java/default/ /usr/java/jdk1.7.0_17/
ln -s /usr/java/latest/ /usr/java/jdk1.7.0_17/
Used this line:
update-alternatives --install java java /usr/java/latest/bin/java 60 --slave jre jre /usr/java/latest --slave rmiregistry rmiregistry /usr/java/latest/bin/rmiregistry --slave tnameserv tnameserv /usr/java/latest/bin/tnameserv --slave rmid rmid /usr/java/latest/bin/rmid --slave ControlPanel ControlPanel /usr/java/latest/bin/ControlPanel --slave policytool policytool /usr/java/latest/bin/policytool --slave keytool keytool /usr/java/latest/bin/keytool --slave javaws javaws /usr/java/latest/bin/javaws
Ran this: (Set default to “2”):
[CODE]update-alternatives --config java
There are 2 alternatives which provide `java’.
Selection Alternative
-
1 /usr/lib64/jvm/jre-1.6.0-ibm/bin/java
-
2 /usr/java/latest/bin/java
Press enter to keep the default[*], or type selection number: [/CODE]
Yet when I run:
update-alternatives --display java
java - status is manual.
link currently points to /usr/java/latest/bin/java
/usr/lib64/jvm/jre-1.6.0-ibm/bin/java - priority 1610
slave rmiregistry: /usr/lib64/jvm/jre-1.6.0-ibm/bin/rmiregistry
slave tnameserv: /usr/lib64/jvm/jre-1.6.0-ibm/bin/tnameserv
slave rmid: /usr/lib64/jvm/jre-1.6.0-ibm/bin/rmid
slave jre_exports: /usr/lib64/jvm-exports/jre-1.6.0-ibm
slave ControlPanel: /usr/lib64/jvm/jre-1.6.0-ibm/bin/ControlPanel
slave policytool: /usr/lib64/jvm/jre-1.6.0-ibm/bin/policytool
slave keytool: /usr/lib64/jvm/jre-1.6.0-ibm/bin/keytool
slave jre: /usr/lib64/jvm/jre-1.6.0-ibm
slave javaws: /usr/lib64/jvm/jre-1.6.0-ibm/bin/javaws
/usr/java/latest/bin/java - priority 60
slave rmiregistry: /usr/java/latest/bin/rmiregistry
slave tnameserv: /usr/java/latest/bin/tnameserv
slave rmid: /usr/java/latest/bin/rmid
slave ControlPanel: /usr/java/latest/bin/ControlPanel
slave policytool: /usr/java/latest/bin/policytool
slave keytool: /usr/java/latest/bin/keytool
slave jre: /usr/java/latest
slave javaws: /usr/java/latest/bin/javaws
Current `best' version is /usr/lib64/jvm/jre-1.6.0-ibm/bin/java.
So I apparently set the priority to a low instead of a high number.
How do I change it?
Environment Variables
Then there are the environment variables that need set.
I read some where that you should do this: (which seems to work, but I am not sure why)
/etc/profile.d/zzz-oracle-java.sh
export JAVA_HOME=/usr/java/latest
export JAVA_ROOT=/usr/java/latest
export JAVA_BINDIR=/usr/java/latest/bin
export JRE_HOME=/usr/java/latest
export JDK_HOME=/usr/java/jdk1.7.0_17
PATH
I did notice that when I execute:
which java
which: no java in (/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin)
Which I am okay with that as I can controll all my apps form the environement variables; but I am sure some people would not like this.
So I end up with some questions:
[LIST]
[]Is this the right method?
[]Where should Java be installed?
[]How can I change the priority of the IBM JDK to a lower number?
[]What is the /etc/alternatives folder supposed to be user for?
[*]What is the /usr/lib64/java… folders supposed to be user for?
[/LIST]
Any comments or suggestions are appreciated.