How to install oracle jdk7 on debian

0

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?

Ryan

Posted 2013-02-24T05:27:23.347

Reputation: 123

Answers

0

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

ziesemer

Posted 2013-02-24T05:27:23.347

Reputation: 844

do i also have to set JAVA_HOME variable? – Ryan – 2013-02-24T05:46:18.493

@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 – 2013-02-24T05:47:58.760