Tuesday, April 16, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 18046  / 2 Years ago, wed, march 2, 2022, 2:20:00

I just installed openjdk-8-jdk. I already had openjdk-7-jdk installed. When I ran echo $JAVA_HOME, it printed /usr/lib/jvm/java-7-openjdk-amd64.



So I tried changing the $JAVA_HOME variable but it resets to above path every time I re-open the terminal.
I have tried setting it in /etc/enviroment /etc/profile /etc/bash.bashrc ~/.bashrc but to no avail.



How can I change it? Also, where the $JAVA_HOME is currently set?


More From » bash

 Answers
3

I figured it out. It was ridiculous mistake by me.



As I set JAVA_HOME in so many files, in all the mess I set it to /usr/lib/jvm/java-7-openjdk-amd64 in ~/.bashrc. So every time I opened the terminal it changed to this no matter what was in all the other files, as ~/.bashrc runs every time teminal is opened.


[#16785] Friday, March 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tiowift

Total Points: 119
Total Questions: 113
Total Answers: 110

Location: South Sudan
Member since Sun, Jul 11, 2021
3 Years ago
;