77

Installing Oracle Java 7 in Debian via apt-get repository doesn't seems to work.

apt-get install oracle-java7-installer

Look like apt-get does not recognize oracle-java7-installer.

tshepang
  • 12,111
  • 21
  • 91
  • 136
AzizSM
  • 6,199
  • 4
  • 42
  • 53
  • 17
    I think this question is pertinent to stackoverflow. It fits into "software tools commonly used by programmers", as per http://stackoverflow.com/help/on-topic – kristianp Jun 29 '13 at 00:28
  • 6
    Agree with @kristianp - nominated for reopening, as new answers may be needed in case different methods are required in future/for different debian versions. – Jules Dec 18 '13 at 23:27
  • 4
    Why would this question be closed as off topic? It is necessary to install Java to be able to use it. I love SO and the great questions and answers. It is my #1 go to destination for trustworthy (smart) questions and answers. – Bryan Mar 19 '14 at 19:40
  • 1
    I agree. All the useful questions on SO (such as this one - see the number of votes) always end up closed. Even questions like "What IDE would you recommend...?" are some of the most useful but always end up getting closed "because they're based on opinion". I though the point of this site was to be help programmers? :-( – SharpC Aug 12 '15 at 20:44
  • 2
    @SharpC common misconception! The purpose of SE is to gather authoritative-like-wikipedia content, if it's going to gather that content to be a catalog of fairly-guaranteed-correct information, it really can't gather recommendations or subjective stuff. Helping eachother is just the game they made to trick us into writing an encyclopedia for them! How tricky right! Just remember in the future, the helping is ancillary, it's the resultant content catalog that is the real goal of all the SE network. – Jimmy Hoffa Aug 12 '15 at 20:51

1 Answers1

166

Managed to get answer after do some google..

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
# Java 7
apt-get install oracle-java7-installer
# For Java 8 command is:
apt-get install oracle-java8-installer
d.danailov
  • 9,594
  • 4
  • 51
  • 36
AzizSM
  • 6,199
  • 4
  • 42
  • 53
  • 32
    Since the author didn't opt to share any of that google research, here's a page from the webupd8team, describing this above process for installing this repo. http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html – rektide Jun 30 '13 at 21:59
  • 3
    you forgot to mention that this should be run under root privileges – chester89 Oct 29 '13 at 11:17
  • and it doesn't work any more, btw – chester89 Oct 29 '13 at 11:24
  • 1
    my bad, I misspelled the filepath – chester89 Oct 29 '13 at 11:30
  • 3
    I tried this just now and it works! – Mohamed Taher Alrefaie Nov 25 '13 at 09:45
  • 4
    If you want to do a silent install, `echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections` as described on [this Ask Ubuntu post](http://askubuntu.com/questions/190582/installing-java-automatically-with-silent-option) – Dolan Antenucci Dec 07 '13 at 20:45
  • always from webupd8 this is another useful resource how to install versions up to java-8 in Ubuntu and Debian http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html – mickthompson Jan 02 '14 at 09:43
  • 1
    Set java home `JAVA_HOME=/usr/lib/jvm/java-7-oracle/` `export JAVA_HOME` – Ben Asmussen Apr 18 '14 at 17:56
  • 1
    I followed the instructions here to install java7. Worked like a charm: http://d.stavrovski.net/blog/post/installing-oracle-java-7-on-debian-wheezy – mlunoe Apr 24 '14 at 19:07
  • 1
    sudo add-apt-repository ppa:eugenesan/java sudo apt-get update sudo apt-get install oracle-java7-installer This worked for me – Chamila Wijayarathna May 12 '14 at 14:50
  • You can also use this debian script http://www.duinsoft.nl/packages.php to install java – higuita May 22 '14 at 10:54
  • 3
    On Debian it is better to use [java-package](https://packages.debian.org/unstable/java-package) to build your own package from official Oracle Java binaries instead of installing untrusted binary packages from untrusted repositories. Besides Oracle's Java is not (re-)distributable... – Onlyjob Aug 25 '14 at 03:11
  • And you can find information about installing Oracle Java on Debian Wiki: https://wiki.debian.org/Java/Sun – Anders Mar 06 '15 at 14:06
  • And for java-8-oracle, we just replace the last time in this answer with `apt-get install oracle-java8-installer` – a3.14_Infinity Oct 19 '15 at 02:04