I am working on Mac OS 10.9 I did not know that macs come with java by default. So I installed my own java(version- 1.8.0_20) Now here is the confusion -
I have a java in the following locations -
/usr/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home//bin/java
whereis java returns the 1st address and which java returns the second address. So I thought something must be wrong in my environment variables. So I read up a little on that and echo $PATH returns this -
/usr/local/hive/hive-0.12.0/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home//bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
I also read that it can be changed in .bashrc or .bash_profile. Both these files contain this -
export PATH=$PATH
So I am not sure in which file I have to make the changes and what changes should I be making.