Hot answers tagged

208 votes
Accepted

Switch between multiple java versions

Apt-get won't overwrite the existing java versions. To switch between installed java versions, use the update-java-alternatives command. List all java versions: update-java-alternatives --list Set ...
danzel's user avatar
  • 5,804
200 votes

How to install OpenJDK 8 on 14.04 LTS?

sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk sudo update-alternatives --config java sudo update-alternatives --config javac
Pankaj Wahane's user avatar
154 votes

How do I install openjdk 7 on Ubuntu 16.04 or higher?

Security Warning Packages in the PPA mentioned below are not updated with security patches to Java. Do not use in production; see alternative answers instead. At time of writing, the ...
onairda's user avatar
  • 3,035
142 votes

Switch between multiple java versions

Use sudo update-alternatives --config java which lists all installed versions with current active one marked and provides dialog to switch: There are 3 choices for the alternative java (providing /...
muet's user avatar
  • 1,421
122 votes
Accepted

How to install JDK sources?

Example for Java 8: sudo apt-get install openjdk-8-source apt-get puts it under the relevant JDK location as src.zip: /usr/lib/jvm/java-8-openjdk-amd64/src.zip Intellij IDEA recognized it ...
AlikElzin-kilaka's user avatar
102 votes
Accepted

Can not install 'openjdk-9-jdk' because it tries to overwrite file aready included in 'openjdk-9-jdk-headless'

You can directly do sudo apt-get -o Dpkg::Options::="--force-overwrite" install openjdk-9-jdk. If you are here, you already tried the installation without the -o Dpkg::Options::="--force-overwrite" ...
Dominic108's user avatar
  • 1,377
66 votes

How do I install openjdk 7 on Ubuntu 16.04 or higher?

Edit 22-Jul-2019: This answer currently does not work. The below referenced JDK packages are no longer available on Debian Experimental. In any case, they lagged behind Ubuntu Trusty's packages which ...
MDMower's user avatar
  • 850
66 votes
Accepted

How to find path to java?

Simply do (in terminal): update-alternatives --list java And you'll get an output like this: $ update-alternatives --list java /usr/bin/gij-5 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java The last ...
Videonauth's user avatar
  • 33.1k
63 votes
Accepted

Why is OpenJDK 10 packaged as openjdk-11-*?

This is because those packages will become OpenJDK 11 when that is released. See this mailing list post: On behalf of the Ubuntu Foundations Team, I am requesting an SRU exception for OpenJDK. ...
muru's user avatar
  • 194k
59 votes

Can not install 'openjdk-9-jdk' because it tries to overwrite file aready included in 'openjdk-9-jdk-headless'

I was able to solve the error myself by forcing the file override when installing the .deb package with dpkg. Here's my workaround to install openjdk-9-jdk on Ubuntu 16.04 Xenial (not tested on ...
Byte Commander's user avatar
  • 106k
58 votes
Accepted

How can I install OpenJDK on Ubuntu 16.04?

had the same problem too.. but i solved it with these commands: sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-7-jre
Chris's user avatar
  • 596
39 votes

How to install JDK sources?

In case of java 11 (on Ubuntu 18.04) I did: First I install jdk 11: sudo apt install openjdk-11-jdk I install the sources like this: sudo apt-get install openjdk-11-source And I found them in /...
Level_Up's user avatar
  • 576
33 votes

Jenkins error "Incorrect Java version" for Java11. After removing Java11 and installing Java8. java is not found anywhere

I've just encountered this problem, and it actually looks like an issue in /etc/init.d/jenkins testing for the Java version. I just posted a solution here: https://dorian.fraser-moore.com/works/...
DorianFM's user avatar
  • 430
26 votes

17.10 openjdk and oracle jdk 8 and 9 the trustAnchors parameter must be non-empty

I reinstalled everything using apt-get and that didn't solve the problem. The solution that I found to work: Go to Oracle and download the tar.gz version of jdk-8. Then copy the cacerts file from ...
Tyler Ruppert's user avatar
25 votes

How to find path to java?

You need to dig into symbolic links. Below is steps to get Java directory Step 1: $ whereis java java: /usr/bin/java /etc/java /usr/share/java That tells the command java resides in /usr/bin/java. ...
Sinscary's user avatar
  • 1,385
24 votes

How can I install OpenJDK on Ubuntu 16.04?

The one I did on 16.04 was: For OpenJDK 8.X sudo apt install openjdk-8-jre For OpenJDK 9.X sudo apt install openjdk-9-jre Note: There was no openjdk-6-jre nor openjdk-7-jre for me on Ubuntu 16.04....
Luis Alvarado's user avatar
23 votes
Accepted

Trying To Install Java 8.. Unable to locate package openjdk-8-jre

OpenJDK8 is not included in Ubuntu 14.04 repositories. You can install Openjdk8 to Ubuntu 14.04 from a PPA this way: sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get ...
Pilot6's user avatar
  • 89k
22 votes
Accepted

Is the openjdk-r ppa trustworty?

Yes, it is trustworthy. The PPA is run by Matthias Klose (Member of Ubuntu, Canonical Partner Developer, Gnome3 Team, Edubuntu developer, Xubuntu developer, ...) . References : Matthias Klose ...
hg8's user avatar
  • 13.4k
19 votes
Accepted

How to install the OpenJDK 8 (Ubuntu 19.04)?

As of now, 30 April 2019 02:00 UTC, Open JDK 8 and its associated packages have been added back to the normal Ubuntu 19.04 Disco Dingo repositories. So you can now do the usual sudo apt install ...
Andrew's user avatar
  • 448
18 votes
Accepted

How to install OpenJDK 8 on 14.04 LTS?

As of 2017-08-08 I found that this question and its answers had become a bit overwhelming to dig through to understand the issue, so I have summarized the findings in this answer. The very short ...
Thorbjørn Ravn Andersen's user avatar
18 votes

Switch between multiple java versions

Configuring Java You can configure which version is the default for use in the command line by using update-alternatives, which manages which symbolic links are used for different commands. sudo ...
naXa stands with Ukraine's user avatar
17 votes

Setup and install IntelliJ with JDK

New way: you can use Ubuntu Make. To install on 16.04 (Xenial) [and later] sudo apt install ubuntu-make If your Ubuntu version if before 16.04 (codename Xenial), you can install from the Ubuntu Make ...
serv-inc's user avatar
  • 3,001
17 votes

Setting JDK 7 as default

The most voted answer which suggests to use update-alternatives only partially answers the question. By using it you very likely to end up with your Java environment being inconsistent. This is ...
J. Will's user avatar
  • 312
17 votes
Accepted

How to get Scilab 6.0.1 working on Ubuntu 18.04 LTS?

* Repository-based method (Scilab works, ATOMS does not work) Update 2021-09-30. Nowadays Scilab is working again, installable by sudo apt-get install scilab. ATOMS still does not work because of bug ...
N0rbert's user avatar
  • 97.5k
16 votes

How do I install openjdk 7 on Ubuntu 16.04 or higher?

You can download a OpenJDK 7 from Azul which may fit your needs. They both have a DEB (for the package system) and a ZIP distribution. I have only worked with the ZIP distribution. http://www.azul....
Thorbjørn Ravn Andersen's user avatar
15 votes
Accepted

How to tell if a certain package exists in the apt repos?

First of all the availability of packages (and different versions) depend highly on the release you have. One can do apt-cache search --names-only '^openjdk-8-.*' to look for package names that ...
heemayl's user avatar
  • 90.6k
15 votes
Accepted

How to install JDK8 on Ubuntu 16?

Usually you install the openjdk like this: sudo apt-get install openjdk-8-jdk Maybe this is the problem. You can look this up at http://openjdk.java.net/install/index.html. If you do this you ...
Booming's user avatar
  • 356
14 votes
Accepted

Unable to open .jar files with Java

You seem to be using a development version of java : Java 9 has not been released yet. So, first of all, you should remove this version of java, and install the default one : sudo apt-get remove ...
Mossroy's user avatar
  • 1,106
14 votes

Java can't find cacerts

Run the following commands: sudo dpkg --purge --force-depends ca-certificates-java sudo apt-get install ca-certificates-java Worked for me.
Currie's user avatar
  • 141
14 votes

java.lang.NoClassDefFoundError: javafx/application/Application

You are getting this error because your runtime PATH to javafx is probably incorrect or missing. Please, follow these steps: Check the path of JavaFX. (example: /usr/share/openjfx/lib/) Then run ...
maninder singh's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible