0

I was trying to install android studio and I needed oracle java 8 but mine is openjdk. while using sudo apt-get install oracle-java8-set-default, I recieve the followings:

The following packages were automatically installed and are no longer required:
checkbox-ng icu-devtools iproute kde-l10n-engb kde-l10n-fa
libatk-wrapper-java libatk-wrapper-java-jni libbind9-90 libcamel-1.2-52
libcapnp-0.4.0 libcolamd2.8.0 libcommon-sense-perl libdns100
libebook-contacts-1.2-1 libecal-1.2-18 libedata-cal-1.2-27
libedataserver-1.2-20 libenca0 libgee2 libgif4 libglew1.10 libglewmx1.10
libgstreamer-plugins-base1.0-dev libgstreamer-vaapi1.0-0
libgstreamer-vaapi1.0-dev libgtop2-10 libicu-dev libimobiledevice4 libisc95
libisccc90 libisccfg90 libisl13 libjson-perl libjson-xs-perl libjsoncpp0v5
libllvm3.6v5:i386 liblouis2 liblwres90 libntdb1 libpgm-5.1-0 libpoppler52
libpth20 libqpdf13v5 libraw10 libscope-harness2 libsctp1 libset-scalar-perl
libsodium13 libtypes-serialiser-perl liburcu2 libusbmuxd2 libva-dev
libva-egl1 libva-glx1 libva-tpi1 libx265-59 libxml2-dev libzmq3
linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic linux-headers-4.2.0-36
linux-headers-4.2.0-36-generic linux-headers-4.4.0-22
linux-headers-4.4.0-22-generic linux-image-4.2.0-16-generic
linux-image-4.2.0-36-generic linux-image-4.4.0-22-generic
linux-image-extra-4.2.0-16-generic linux-image-extra-4.2.0-36-generic
linux-image-extra-4.4.0-22-generic lksctp-tools python-cffi
python-characteristic python-dbus-dev python-ntdb python-ply
python-pycparser python-support python3-cffi python3-checkbox-ng
python3-colorama python3-ply python3-pycparser
qtdeclarative5-localstorage-plugin qtdeclarative5-qtfeedback-plugin
telepathy-indicator ubuntu-snappy-cli unity-scope-audacious
unity-scope-clementine unity-scope-gmusicbrowser unity-scope-gourmet
unity-scope-guayadeque unity-scope-musique upstart-bin
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.

and error follows as below:

dpkg: error processing package oracle-java8-set-default (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                          Errors were encountered while processing:
oracle-java6-installer
oracle-java7-installer
oracle-java8-installer
oracle-java8-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)

I guess this is due to filterations in my country and I do not know what I should do to fix it. Can you help me?

Athena
  • 162

2 Answers2

2

Try to use this:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Hope it will help

1

There are two ways of installing java in ubuntu machine.online(by ppa)

 sudo add-apt-repository ppa:webupd8team/java 
 sudo apt-get update 
 sudo apt-get install oracle-java8-installer

and offline by following procedure given in the link. First download the jdk for ubuntu from official site of oracle best for your system architecture (tar.gz file) and then Follow the procedure step by step(copy instructions on terminal) **Make sure when u copy it on terminal change the whole jdk...... thing to the filename of jdk u just downloaded. Images shown are old so where ever it will be jdk 1.7.0_45 change it to proper jdk version(u can check which one is installed while following the procedure)

Link : http://m.wikihow.com/Install-Java-on-Ubuntu

Advantages of offline installer: u can install it again n again in case of system failure/reinstall and it is fast where as installing it via terminal will take time and u will need internet again to reinstall in case of system failure

minigeek
  • 1,071