-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove-default-jdk.sh
executable file
·33 lines (26 loc) · 1.18 KB
/
remove-default-jdk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -
# Remove all the Java related packages \
# (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ)
dpkg-query -W -f='${binary:Package}\n' | \
grep -E -e '^(ia32-)?(sun|oracle)-java' \
-e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' \
-e '^gcj-(.*)-j(re|dk)' \
-e '^java-common' | xargs apt-get -y remove
apt-get -y autoremove
# Purge config files
dpkg -l | grep ^rc | awk '{print($2)}' | xargs apt-get -y purge
#Remove Java config and cache directory:
#bash -c 'ls -d /home/*/.java' | xargs rm -rf
# Remove manually installed JVMs:
rm -rf /usr/lib/jvm/*
# Remove Java entries, if there is still any, from the alternatives:
#for g in ControlPanel java java_vm javaws jcontrol jexec keytool \
# mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry \
# servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter \
# idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo \
# jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic \
# schemagen serialver wsgen wsimport xjc xulrunner-1.9-javaplugin.so;
#do update-alternatives --remove-all $g; done
# Search for possible remaining Java directories:
#updatedb
#locate -b '\pack200'