I installed java-8 using a PPA. After that I gave a command:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
I had heard somewhere that this command does temporary changes. But after many logouts and logins, these commands below still works (I think due to that export ... command):
java -version
javac -version
But when I give the command:
export -p
It shows a list of environment variables, but in that list, does not show variable JAVA_HOME. Moreover, I wonder how the commands java and javac still works!
Can someone tell me in which file export command make changes? Are they temporary or permanent? And what else happens above? Please elaborate!
/etc/environment, but there is nothing like/usr/lib/jvm/java-8-oracle...assigned in the PATH variable. Then what else might be happening? – Ankur Shah Mar 20 '16 at 09:33type -a java javac. Are those directories in yourPATH? – muru Mar 20 '16 at 09:34java is /usr/bin/java,javac is /usr/bin/javac. And I also saw/usr/binin PATH variable. I think I get it now! Is it? – Ankur Shah Mar 20 '16 at 09:38/usr/bin, which is already inPATH, so no changes toPATHwere needed.JAVA_HOMEis for other software, so just thejavaandjavaccommands will work without it. – muru Mar 20 '16 at 09:43