I downloaded a fuller version of java, and I wanted to update the default path to java. I tried updating the bashrc file as they did here http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/ , but that did not work. How do I fix this?
Asked
Active
Viewed 7,716 times
2
2 Answers
1
Also I needed to do this export JAVA_HOME=/usr/local/java/
Where /usr/local/java/
is a symbolic link for the current version of java that you want the server to use.
Also in the /etc/profile
file I set the following:
export JAVA_HOME=/usr/local/jdk1.8.0_31/
export PATH=$JAVA_HOME/bin:$PATH

peterh
- 9,731

Daryn Hyland
- 11
-
Please don't post multiple answers. Edit your first one and include all relevant information. Each answer should stand alone, so please explain the entire process you followed in a single post then delete the other one. Finally, changing links in
/etc/alternatives
manually is not a good idea, that's whatupdate-alternatives
is for. In this case,update-java-alternatives
. – terdon Feb 18 '15 at 11:43
1
You need to add your new java path to the beginning of the PATH
variable. Check the following example.
export PATH=/usr/java/jdk1.7/bin:$PATH
Then, type source /etc/profile
or ~/.bashrc
to reload the path settings.

terdon
- 242,166

Manula Waidyanatha
- 2,263
1.5.0_07
to the version you downloaded? Where did you install the new version? Was it an.rpm
, a.tar
, a.bin
, or something else? Where and how did you download the new version? Which URL or command did you use? – Mikel May 25 '12 at 04:50