06 May 2014

Put java on your path after install jdk manually in linux

Some times, you do install your JDK manually in Linux and then you have to put `java` executables in your PATH...

You can just put $JAVA_HOME/bin in your path... or you can use `alternatives` system.

To use alternatives... so you can have multiple jdk/jre installed on the same machine and you choose among then, you will need to add them to alternatives system...

cd /path/to/java/home/bin
for f in *; do sudo update-alternatives --install /usr/bin/$f $f /usr/lib/jvm/java-8-oracle/bin/$f 0; done;


And that's all!

No comments: