Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .