0

I need to install Java jdk 11 on my lubuntu laptop, but when I write this in the terminal: sudo apt-get install oracle-java11-installer I get this:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 google-chrome-stable : Depends: libappindicator3-1 but it is not going to be installed
 oracle-java11-installer : Depends: java-common (>= 0.24) but it is not going to be installed
                           Recommends: gsfonts-x11 but it is not going to be installed
                           Recommends: oracle-java11-set-default but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

and

> Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 google-chrome-stable : Depends: libappindicator3-1 but it is not going to be installed
 openjdk-11-jre-headless : Depends: ca-certificates-java but it is not going to be installed
                           Depends: java-common (>= 0.28) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

for sudo apt install openjdk-11-jre-headless

How do I fix this?

when i tried fix broken install I got this

E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)

E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

I don't really care if I get open or oracle java, I just need to install jdk.

I have Lubuntu 18.10

when using sudo apt install I get this error:

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 google-chrome-stable : Depends: libappindicator3-1 but it is not going to be installed
 oracle-java11-installer : Depends: java-common (>= 0.24) but it is not going to be installed
                           Recommends: gsfonts-x11 but it is not going to be installed
                           Recommends: oracle-java11-set-default but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Thanks

NikolaJ
  • 11

1 Answers1

0

Try installing java-common and libappindicator3-1 like apt is suggesting.

do:

sudo apt install libappindicator3-1 java-common

That should fix up most of the oracle java errors (for dpkg system).

There is another way to install JAVA on your system, one which does not depend upon your apt system.

You can download the non deb version of Java from Sun and the install instructions are here.

To ensure the correct java is called:

First install the downloaded java as an alternate:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0.05/bin/java 1

This is assuming that you have installed the java (which you just downloaded) into /usr/lib/jvm/jdk1.8.0.05/

You may change this location as per your install.

Next, set this one as default, Do:

 sudo update-alternatives --config java

and choose the version you want as default.