I've Installed oracle JDK version 1.8 on a debian machine that already has openjdk 1.6.i've set the path variable in etc/login.defs and java_home variable In etc/environment.
When I echo $JAVA_HOME it points to the oracle version correctly and when I run javac It uses the oracle 1.8 version.
The problem is when I run the java command , It runs the openjdk 1.6 version and I'm not sure why.If I type java -version It shows the openjdk version.
when you type something on the command line, the OS has to figure out where the program is you want to run. The PATH variable is a list of directories the OS will search for your command. There may be some subtleties involved, but basically, it search each directory listed, in the order you have them listed, until it finds a match. If you have multiple version of java installed, or even the java.exe in multiple directories, the OS stops looking as soon as it finds ANY java.exe.
So echo your PATH, and you will find the 1.6 directory before the 1.8
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
posted 5 years ago
Thanks! I thought It wasn't set In the $PATH
I was looking for /usr/lib/jvm but It appears to also be In /usr/sbin
Can you smell this for me? I think this tiny ad smells like blueberry pie!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop