DEV Community

Discussion on: Install and manage multiple Java versions on Linux using alternatives

Collapse
 
hectorhugocc profile image
Hector Hugo

I have a problem. Using the 'echo $ PATH' command returns me a value but when reviewing the 'etc/environment' file you see another value. The same goes for the JAVA_HOME variable. Could you tell me what it is? Thanks for the support.

Collapse
 
thegroo profile image
Marcos Maia

Hum.... most likely you have in one of these files under your $HOME folder: .bash_profile, .bashrc, .zshrc or similar a configuration setting the $JAVA_HOME specifically to an existing installation? If you have I would recommend you to remove the entry and source the file or restart / login again to see if it's gone. In most cases you don't really need a $JAVA_HOME hardcoded in your profiles(with some exceptions).

If you type only env in your terminal you should see all existent variables in your machine.