Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Java 8 on cloud9

I'm trying to install java 8 on cloud9 through the webupd8 PPA. So I'm adding the repository

sudo add-apt-repository ppa:webupd8team/java

Next I do the update and finally when I run the command

sudo apt-get install oracle-java8-installer

I get the error

E: Unable to locate package oracle-java8-installer

Any ideas how can I get through that and istall java 8 on cloud9?

like image 520
Dimitris Poulopoulos Avatar asked Apr 06 '16 08:04

Dimitris Poulopoulos


People also ask

Does Cloud9 support Java?

AWS Cloud9 provides enhanced language support to improve your development experience when working with Java. Key productivity features include code completion, linting for errors, code lenses, and debugging options such as breakpoints and stepping.


2 Answers

As noted by christophetd, I completed the following steps and everything installed without issue:

$ sudo vim /etc/apt/sources.list

Add the following lines of code to the file:

deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

$ sudo apt-get update

$ sudo add-apt-repository ppa:webupd8team/java

$ sudo apt-get install oracle-java8-installer

$ java -version

java version "1.8.0_101"
like image 114
John Zukowski Avatar answered Oct 27 '22 01:10

John Zukowski


Add the two following lines to your file /etc/apt/sources.list (which you can create if it does not exist)

deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

Then run sudo apt-get update, and you should be able to install oracle-java8-installer.

This basically does the add-apt-repository manually. I suspect the issue is due to the fact that the default source files /etc/apt/sources.list.d/* are mounted as read-only (see for instance this topic on Cloud9 community)

like image 27
christophetd Avatar answered Oct 27 '22 01:10

christophetd