update-alternatives just for one user
5,242
On Debian and derivates, you should probably use update-java-alternatives
. Anyway, all those tools are system related, not user related. If you want to use a different java, simply put those lines in your ~/.profile
:
JAVA_HOME=/usr/lib/jvm/java-6-sun
JRE_HOME=/usr/lib/jvm/java-6-sun/jre
PATH=$JAVA_HOME/bin:"$PATH"
export JAVA_HOME JRE_HOME
Related videos on Youtube
Author by
AK4VL
Updated on September 18, 2022Comments
-
AK4VL almost 2 years
I'm using a shared server. On that server different versions of Java are installed:
Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode * 1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode 2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
I would like to choose the Second options, but if I tried to do that it complains that I do not have the permissions (I'm not root).
Is there a way to do that in "user-space"?
Can the Root user make this preference works only for me?
-
Sam Brightman over 7 yearsThe accepted answer is probably preferrable here but if you genuinely need to use your own alternatives see my answer at ServerFault.
-