Quote:
Originally Posted by AlucardZero
install sun-java5-jre
then (as root) update-alternatives --config java
|
Thanx for the quick reply,
update-alternatives --config java was the command i was looking for.
I thought the command was something like 'java-config' lol (it's probably only a tool existing on Gentoo)
I'd rather not using jre5 because it is only a renamed jre1.4.2 plus minor changes.
I downloaded the jdk bin on oracle's website and installed it in /opt/jdk1.6.0_18/
I added to the /etc/profile:
export JAVA_HOME=/opt/jdk1.6.0_18
export PATH=$PATH:$JAVA_HOME/bin
But nothing is installed in the /etc/alternatives so update-alternatives cannot find anything else than gcj in the 'java group'.
So i read a little about update-alternatives and in the debian FAQ, i found how to add my jdk to the 'java group':
# update-alternatives --install /usr/bin/java java /opt/jdk1.6.0_18/bin/java 90
# update-alternatives --install /usr/bin/javac javac /opt/jdk1.6.0_18/bin/javac 90
As said in the FAQ:
The first argument to `--install' option is the symlink that points to /etc/alternatives/NAME, where NAME is the second argument. The third argument is the program to which /etc/alternatives/NAME should point to, and the fourth argument is the priority (larger value means the alternative will more probably get picked automatically).
The result is:
# update-alternatives --config java
Il y a 2 alternatives fournissant «Â*javaÂ*».
Sélection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
*+ 2 /opt/jdk1.6.0_18/bin/java
Appuyez sur Entrée pour conserver la valeur par défaut[*] ou choisissez le numéro sélectionnéÂ*:2
Utilisation de «Â*/opt/jdk1.6.0_18/bin/javaÂ*» pour fournir «Â*javaÂ*».
# java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)
Thanx again