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:
Appears the binaries are:
Which only has:
drwxr-xr-x 3 root root 4096 Mar 12 10:45 jce/
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:
(I installed both the JDK and JRE and do realizes I only need the JDK)
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 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)
The alternatives MESS!
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/
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:
Set a softlink as:
zypper in jre-7u7-linux-x64.rpm -y
Used this line:
ln -s /usr/java/default/ /usr/java/jdk1.7.0_17/
ln -s /usr/java/latest/ /usr/java/jdk1.7.0_17/
Ran this: (Set default to "2"):
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
Yet when I run:
update-alternatives --config java
There are 2 alternatives which provide `java'.
+ 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:
So I apparently set the priority to a low instead of a high number.
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.
How do I change it?
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)
I did notice that when I execute:
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:
- 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?
Any comments or suggestions are appreciated.