Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
Did you change 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 4:50
    
Yeah, I downloaded it, etc. and set the path variable to that location. But it looks in the previous location first. (i.e. if I run 'which java', it gives the path to the old download. Is there a way (other than by just moving the old java) to reorder the places that it looks for java? –  user1253952 May 25 '12 at 5:03

1 Answer 1

up vote 0 down vote accepted

What you need to do is when setting PATH variable set your new java path to the begging of PATH variable. Check the following example.

export PATH=/usr/java/jdk1.7/bin:$PATH

The type source /etc/profile or ~/.bashrc to reload the path settings.

share|improve this answer
    
oh my, that's all it was :/ thanks so much! –  user1253952 May 25 '12 at 5:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.