knute
Posts: 343
Joined: Thu Oct 23, 2014 12:14 am

How do I remove Java 8 from my Pi?

Sat Jul 28, 2018 6:02 pm

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...

User avatar
DougieLawson
Posts: 33352
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

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

Sat Jul 28, 2018 6:19 pm

Try
sudo apt purge java-common oracle-java8-jdk
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

knute
Posts: 343
Joined: Thu Oct 23, 2014 12:14 am

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

Mon Jul 30, 2018 8:22 pm

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

User avatar
DougieLawson
Posts: 33352
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

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

Mon Jul 30, 2018 8:24 pm

sudo apt-mark hold oracle-java7-jdk may prevent that.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

knute
Posts: 343
Joined: Thu Oct 23, 2014 12:14 am

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

Tue Jul 31, 2018 6:19 pm

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.

User avatar
HawaiianPi
Posts: 2488
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

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

Fri Aug 03, 2018 3:14 pm

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.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

knute
Posts: 343
Joined: Thu Oct 23, 2014 12:14 am

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

Fri Aug 03, 2018 7:31 pm

Well thanks, I never would have figured that out on my own!

Return to “Java”

Who is online

Users browsing this forum: No registered users and 1 guest