Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I downloaded the binary of tar.gz format from oralce website. I extracted it to /usr/bin/jdk7. How to "install" it and make it the default jdk and jre?

share|improve this question

migrated from stackoverflow.com Feb 24 '13 at 7:47

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 0 down vote accepted

Short answer: Just ensure that /usr/bin/jdk7 has the first occurrence of java (and optionally, its associated tools) on your $PATH.

Longer answer:

On my Ubuntu instance (being a derivative of Debian), this occurrence is /usr/bin/java, which links to /etc/alternative/java. Some documentation for the "alternatives" system for Debian is available at http://wiki.debian.org/DebianAlternatives and http://www.debian.org/doc/manuals/debian-faq/ch-customizing.en.html .

Alternatively, just do something like this at the beginning of your session (or automatically in ~/.bashrc, etc.):

export PATH=/usr/bin/jdk7/bin:$PATH
share|improve this answer
    
do i also have to set JAVA_HOME variable? –  Ryan Feb 24 '13 at 5:46
    
@Ryan - depends upon what you're using. Not all programs expect or respect $JAVA_HOME. Those that do, usually just use it to help set a local $PATH anyway. –  ziesemer Feb 24 '13 at 5:47

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.