Page 1 of 1

How do I remove Java 8 from my Pi?

Posted: Sat Jul 28, 2018 6:02 pm
by knute
If I do apt purge oracle-java8-jdk it wants to install java7. I just want to remove all of the installed java so I can install the latest version from a file.

[email protected]:~ $ sudo apt purge oracle-java8-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ca-certificates-java default-java-plugin default-jre default-jre-headless
icedtea-8-plugin icedtea-netx icedtea-netx-common libatk-wrapper-java
libatk-wrapper-java-jni openjdk-8-jre openjdk-8-jre-headless
oracle-java7-jdk
Suggested packages:
fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
fonts-wqy-zenhei fonts-indic
The following packages will be REMOVED:
oracle-java8-jdk*
The following NEW packages will be installed:
ca-certificates-java default-java-plugin default-jre default-jre-headless
icedtea-8-plugin icedtea-netx icedtea-netx-common libatk-wrapper-java
libatk-wrapper-java-jni openjdk-8-jre openjdk-8-jre-headless
oracle-java7-jdk
0 upgraded, 12 newly installed, 1 to remove and 0 not upgraded.
Need to get 80.2 MB of archives.
After this operation, 76.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
[email protected]:~ $


Thanks,

knute...

Re: How do I remove Java 8 from my Pi?

Posted: Sat Jul 28, 2018 6:19 pm
by DougieLawson
Try
sudo apt purge java-common oracle-java8-jdk

Re: How do I remove Java 8 from my Pi?

Posted: Mon Jul 30, 2018 8:22 pm
by knute
It still wants to install Java 7.

[email protected]:~ $ sudo apt purge java-common oracle-java8-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
oracle-java7-jdk
The following packages will be REMOVED:
java-common* oracle-java8-jdk*
The following NEW packages will be installed:
oracle-java7-jdk
0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
Need to get 53.0 MB of archives.
After this operation, 18.4 MB disk space will be freed

Re: How do I remove Java 8 from my Pi?

Posted: Mon Jul 30, 2018 8:24 pm
by DougieLawson
sudo apt-mark hold oracle-java7-jdk may prevent that.

Re: How do I remove Java 8 from my Pi?

Posted: Tue Jul 31, 2018 6:19 pm
by knute
That doesn't work either but the bit about removing wolframe-engine is interesting.

[email protected]:~ $ sudo apt-mark hold oracle-java7-jdk
oracle-java7-jdk set on hold.
[email protected]:~ $ sudo apt purge oracle-java8-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
coinor-libipopt1v5 libexiv2-14 libgmime-2.6-0 libgpgme11 libmumps-seq-4.10.0
wolframscript
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
ca-certificates-java default-java-plugin default-jre default-jre-headless
icedtea-8-plugin icedtea-netx icedtea-netx-common libatk-wrapper-java
libatk-wrapper-java-jni libxt-dev openjdk-8-jdk openjdk-8-jdk-headless
openjdk-8-jre openjdk-8-jre-headless
Suggested packages:
libxt-doc openjdk-8-demo openjdk-8-source visualvm fonts-ipafont-gothic
fonts-ipafont-mincho fonts-wqy-microhei fonts-wqy-zenhei fonts-indic
The following packages will be REMOVED:
oracle-java8-jdk* wolfram-engine*
The following NEW packages will be installed:
ca-certificates-java default-java-plugin default-jre default-jre-headless
icedtea-8-plugin icedtea-netx icedtea-netx-common libatk-wrapper-java
libatk-wrapper-java-jni libxt-dev openjdk-8-jdk openjdk-8-jdk-headless
openjdk-8-jre openjdk-8-jre-headless
0 upgraded, 14 newly installed, 2 to remove and 0 not upgraded.
Need to get 34.3 MB of archives.
After this operation, 868 MB disk space will be freed.

Re: How do I remove Java 8 from my Pi?

Posted: Fri Aug 03, 2018 3:14 pm
by HawaiianPi
You don't remove the old version first. You install the newer version, then remove the older version.

But rather than installing manually from a file, use the webupd8team ppa, which will install the latest Java 8 for you, and keep it up to date with normal apt update/upgrades.

Open a terminal and do the following:

Code: Select all

sudo su
apt install dirmngr
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt update
apt install oracle-java8-installer
This will take a little while, and you'll have to agree to the Oracle terms, so pay attention.

When that is finished you can remove the old Java version. If you had the default oracle-java8-jdk installed, remove it with,

Code: Select all

apt remove oracle-java8-jdk
then you can exit the root terminal.

Enter java -version to check your installed version (it should be the latest).

[email protected]:~ $ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) Client VM (build 25.181-b13, mixed mode)


Congrats, you now have the latest Java 8 version, and it will update with the rest of your packages.

Re: How do I remove Java 8 from my Pi?

Posted: Fri Aug 03, 2018 7:31 pm
by knute
Well thanks, I never would have figured that out on my own!