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 have Installed JDK 7 on CentOS 32 bit virtual machine. I also have set the path for java. In one terminal it is showing java1.7 But when I open another terminal and look for, java -version It is showing java1.4 Need solution, Can anyone help me on this

share|improve this question
1  
Where have you set the path? In e.g ~/.bashrc ? –  MrSmith42 Oct 8 '13 at 7:36
    
Run which java and echo $PATH on both shells, and attach the output –  warl0ck Oct 8 '13 at 8:30
    
CentOS does not user 'alternative' command for this? '/usr/sbin/alternatives –install /usr/bin/java java /usr/java/latest/bin/java 20000' –  BitsOfNix Oct 8 '13 at 11:36
    
How did you install Java? Via the RPMs or as a tarball? if-not-true-then-false.com/2010/… –  slm Dec 6 '13 at 7:16

1 Answer 1

That's just because you probably set the path for java using export in a terminal. That will only work for the current session (terminal).

To make it permanent, you would have to add the export line you used to your ~/.bashrc file.

share|improve this answer

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.