1

To uninstall java I followed this.

When I have uninstalled java completely , java -version shows openjdk version "11.0.1" . It's supposed to be no java at all, isn't it?. enter image description here

Then I've installed java 8, still java -version command yields openjdk version "11.0.1".

I need java for running a bioinformatics tool called Integrative Genomics Viewer(igv). After installing java 8 it continues to tell me I need java 8. enter image description here

Please help.

  • 2
    What is the output of `apt list --installed | grep jdk`? – Kulfy Dec 27 '18 at 06:56
  • 1) which Java version(s) have you installed? 2) In Ubuntu/Debian you can install several versions/variants of the same package and then use the `update-alternatives` to make one the default. – xenoid Dec 27 '18 at 07:15
  • I've used update-alternatives while both java 11 and java 8 were installed. But it didn't work so I decided to completely uninstall the java and only use java 8 (which I need at the moment). – Ahmed Abdullah Dec 27 '18 at 07:18
  • @Kulfy apt list --installed | grep jdk returns "WARNING: apt does not have a stable CLI interface. Use with caution in scripts." and no other result – Ahmed Abdullah Dec 27 '18 at 07:25
  • 1
    and output of `which java` and `which javac`? – Kulfy Dec 27 '18 at 07:31
  • With java, you don't use `update-alternatives` but `update-java-alternatives` as I described [here](https://askubuntu.com/a/740782/354663). – danzel Dec 27 '18 at 09:53
  • @danzel I followed your answer https://askubuntu.com/a/740782/814468 before I tried removing java. It didn't work. Somehow I am stuck with java version 11 even when no java is installed apparently. – Ahmed Abdullah Dec 27 '18 at 09:56
  • @Kulfy openjdk version "11.0.1" & javac 11.0.1 – Ahmed Abdullah Dec 27 '18 at 10:01
  • How did you installed java 8? Also, `which` command usually returns path of executable file. Are you sure that is the output of `which java` and `which javac`? – Kulfy Dec 27 '18 at 10:05
  • for java 8 installation I followed commands provided by this page http://tipsonubuntu.com/2016/07/31/install-oracle-java-8-9-ubuntu-16-04-linux-mint-18/ – Ahmed Abdullah Dec 27 '18 at 10:12
  • There is no need to follow those instructions unless you need oracle JDK. For installing JDK 8 you can simply use `sudo apt install openjdk-8-jre openjdk-8-jdk` since they are present in official repository. Let me know if it overwrites the existing settings. – Kulfy Dec 27 '18 at 10:32
  • Nope. still same problem – Ahmed Abdullah Dec 27 '18 at 10:35
  • How did you installed jdk11 in past? – Kulfy Dec 27 '18 at 10:41
  • I can't remember. – Ahmed Abdullah Dec 27 '18 at 11:02
  • And what about `apt list --installed | grep jre`? I'll suggest you to install openjdk-11 from repository once again using `sudo apt install openjdk-11-jdk openjdk-11-jre` and uninstall using `sudo apt autoremove openjdk-11-jdk openjdk-11-jre` to get of its all traces. – Kulfy Dec 28 '18 at 13:57

2 Answers2

2

The IGV program started for me, these were the steps I took:

I uninstalled my version of Java and installed Java 8.

$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

$ sudo apt remove openjdk*

$ java -version
bash: /usr/bin/java: No such file or directory

$ sudo apt update

$ sudo apt install openjdk-8-jdk

$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

$ cd  Downloads/IGV_2.4.16
~/Downloads/IGV_2.4.16 $ ls
igv.command  igv.sh  lib  readme.txt

$ chmod a+x igv.sh  //Made the script executable
$ ./igv.sh  //Execute the script and start the program.

Hope this works for you.

Kulfy
  • 17,416
  • 26
  • 64
  • 103
0

Sounds like you did not delete openjdk if it's still listed. Try running sudo apt-get purge --auto-remove openjdk* to remove the unsupported version of java, then install java 8.