1

how to set different versions of java to different users in Linux for example if we login as root then the default java version must be jre-1.8.141 and if we login as the normal user say (rob) then the default java version should be jre-1.8.144.

    1 Answer 1

    1

    It is quite trivial. Add this to the user .bashrc file

    export JAVA_HOME=/path/to/javaXYZdir export PATH=${JAVA_HOME}/bin:$PATH 

    Mind XYZ.

    This assumes user shell is bash.

      You must log in to answer this question.

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.