0

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

dsh
  • 12,037
  • 3
  • 33
  • 51
  • it seems to be that it searches for packages for Xenial Xerus, Ubuntu 16.04 which is Alpha while I write this comment. Do you maybe know why it might think that you are running on Ubuntu 16.04? – syss Feb 23 '16 at 20:10

5 Answers5

4

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

Markus Weninger
  • 11,931
  • 7
  • 64
  • 137
  • It notified "Unable to locate package openjdk8" – Gauss Shiroemon Madeon Feb 24 '16 at 13:29
  • @GaussShiroemonMadeon: Try `sudo apt-get install openjdk-8-jdk`, I updated the answer. Otherwise, just tpye `sudo apt-get install openjdk` and hit "Tabulator", then apt-get will show you all possible packages. – Markus Weninger Feb 24 '16 at 13:41
  • thank you. I tried. and the result: openjdk-8-jdk is already the newest version (8u72-b15-2ubuntu3). 0 upgraded, 0 newly installed, 0 to remove and 1438 not upgraded – Gauss Shiroemon Madeon Feb 24 '16 at 14:03
  • @GaussShiroemonMadeon: Then just look into `/usr/lib/jvm/` and you should find your JVM(s) installed. My _java_ executable is located at `/usr/lib/jvm/java-8-openjdk-amd64/bin/java` – Markus Weninger Feb 24 '16 at 14:12
  • Me too. my java executable is located at /usr/lib/jvm/java-8-openjdk-amd64/bin/java – Gauss Shiroemon Madeon Feb 24 '16 at 14:15
  • @GaussShiroemonMadeon: So, is your problem fixed? If so, you can use the tick mark to accept this as an answer. – Markus Weninger Feb 24 '16 at 14:20
  • i don't know. when I typed sudo add-apt-repository ppa:webupd8team/java it was failed – Gauss Shiroemon Madeon Feb 24 '16 at 15:15
  • @GaussShiroemonMadeon: If you have OpenJDK installed (as we just made sure), why do you still want to use `sudo add-apt-repository ppa:webupd8team/java`? Is there a special reason for this? You _already have_ Java installed, the OpenJDK version, not the Oracle version. There is nearly no difference between those two, if you want to have more info on the difference, [have a look at this answer explaining it](http://stackoverflow.com/questions/35508612/where-to-download-hotspot-jvm-different-from-oracles-jvm/35513000#35513000) – Markus Weninger Feb 24 '16 at 15:39
0


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 .

Arash Khazaei
  • 11
  • 1
  • 5
0

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

dsh
  • 12,037
  • 3
  • 33
  • 51
0

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.

user1812668
  • 83
  • 1
  • 5
  • You can use this command sudo apt-get install python-software-properties sudo add-apt-repository ppa:webupd8team/java sudo apt-get update – user1812668 Feb 23 '16 at 17:01
0

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
Bruno Peres
  • 15,845
  • 5
  • 53
  • 89
Akitha_MJ
  • 3,882
  • 25
  • 20