Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.