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
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.
- The Overflow Blog
- Featured on Meta
Related
Hot Network Questions
- A "paradox" in classical dynamics
- Using standard AC fixtures for DC applications
- Is there a way to get \marginpar to work with enumext*?
- Summing amplifier instead of DC boost converter
- Why do we multiply by 2 in a two-tailed test when the test statistic’s distribution is not symmetric?
- Polynomial Game
- Have you seen my power series?
- Are there two "Saviors," or just one "Savior" manifest in two divine personages, in Titus 1?
- Mechanism of cyclopropane ring formation from malonate ester
- Does OPTIMIZE FOR UNKNOWN do anything for table-valued variables/parameters?
- Smallest possible pentomino farm
- How to read a line from a file and output the line to a file
- Tetris Perfect Clear puzzles
- Rounding Float Values in ML Models
- Combining vs. Separating Predictors: What’s Better for Prediction
- Could charging a judge with a felony to get them suspended be "scaled up" indiscriminately by the US Department of Justice?
- Why did Germany allow and help introduce the Deutsche Mark to Montenegro?
- How do you sue what is likely to be a shell company?
- Is termination of employment for refusal to work overtime legal?
- Plot two fuctions and the region between them: Axis labels at wrong position
- John 14:13: Pray to Jesus or the Father?
- Medieval isekai manhwa about a woman who works in a palace as a florist
- What is stopping trader taking arbitarge in HKD-USD
- My 3-way switch only works PLUGGED IN to a socket, but not when wired directly?