install Java on ubuntu 15.10

I'm installing Java on Ubuntu 15.10 when I typed sudo add-apt-repository ppa:webupd8team/java The result

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 95, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Ubuntu/xenial

How to fix it? thank you

Upvotes: 0

Views: 1135

Answers (5)

Akitha_MJ
Akitha_MJ

Reputation: 4294

Open Applicaction -> Accessories -> Terminal

Type in the command line as below:

sudo apt-get install openjdk-8-jdk

Type in the command line as below:

apt-cache search jdk

(Note: openjdk-8-jdk is symbolically used here. You can choose the JDK version as per your requirement.)

For "JAVA_HOME" (Environment Variable) type command as shown below, in "Terminal" using your installation path:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk

(Note: "/usr/lib/jvm/java-8-openjdk" is symbolically used here just for demostration. You should use your path as per your installation.)

For "PATH" (Environment Variable) type command as shown below, in "Terminal" using your installation path:

export PATH=$PATH:/usr/lib/jvm/java-8-openjdk/bin

(Note: "/usr/lib/jvm/java-8-openjdk" is symbolically used here just for demonstration. You should use your path as per your installation.)

Check for "open jdk" installation, just type command in "Terminal" as shown below:

javac -version

Upvotes: 0

Markus Weninger
Markus Weninger

Reputation: 12658

Just use sudo apt-get install openjdk-8-jdk if OpenJDK also meets your needs (and most probably it will if you aks about "installing Java")

For OpenJDK 8, you should then be able to find your Java executable in /usr/lib/jvm/java-8-openjdk-amd64/bin/java

Upvotes: 4

user1812668
user1812668

Reputation: 83

Well, you need to check if you are behind a proxy??

So you need to set the https_proxy environmental variable to your custom setting, for example:

export https_proxy=http://myproxy.domain.net:8080/

after that, you can run the commnad "sudo add-apt-repository ppa:webupd8team/java"

I don't know why the add-apt-repository doesn't use the proxy settings for apt.

Upvotes: 0

dsh
dsh

Reputation: 12214

It looks like that PPA doesn't have anything for Ubuntu 15.10.

I use java-package to convert the tarball from Oracle to a .deb package.

PS. this question is better suited for askubuntu

Upvotes: 0

Arash Khazaei
Arash Khazaei

Reputation: 11


Why You Going Trough The Hard Way ? .
Just Open Ubuntu Software Center And Search For JDK And Click On Install Button . So Easy
check your sources.list file in /etc/apt/sources.list and make sure the file is not changed or broken .

Upvotes: 0

Related Questions