I tried the following command

aptitude install sun-java6-jdk

It prompts me that the following packages will be removed.

ant{u} ant-gcj{u} ant-optional{u} ant-optional-gcj{u} ca-certificates-java{u} default-jre{u} default-jre-headless{u} fastjar{u} gcj-4.4-base{u} gcj-4.4-jre-lib{u} icedtea-6-jre-cacao{u} icedtea-netx{u} jarwrapper{u} junit{u} junit4{u} libasm3-java{u} libaudio2{u} libcommons-beanutils-java{u} libcommons-codec-java{u} libcommons-collections3-java{u} libcommons-compress-java{u} libcommons-digester-java{u} libcommons-el-java{u} libcommons-httpclient-java{u} libcommons-logging-java{u} libdb-je-java{u} libdb4.7-java{u} libdb4.7-java-gcj{u} libecj-java{u} libequinox-osgi-java{u} libgcj-bc{u} libgcj-common{u} libgcj10{u} libhamcrest-java{u} libice-dev{u} libicu4j-java{u} libjasper-java{u} libjaxp1.3-java{u} libjetty-java{u} libjline-java{u} libjsch-java{u} libjtidy-java{u} liblucene2-java{u} libpthread-stubs0{u} libpthread-stubs0-dev{u} libregexp-java{u} libservlet2.4-java{u} libservlet2.5-java{u} libslf4j-java{u} libsm-dev{u} libx11-dev{u} libxau-dev{u} libxcb1-dev{u} libxdmcp-dev{u} libxerces2-java{u} libxt-dev{u} linux-headers-2.6.32-38{u} linux-headers-2.6.32-38-generic{u} openjdk-6-jre{u} openjdk-6-jre-headless{u} openjdk-6-jre-lib{u} realpath{u} sat4j{u} ttf-dejavu-extra{u} tzdata-java{u} x11proto-core-dev{u} x11proto-input-dev{u} x11proto-kb-dev{u} xtrans-dev{u}

Is it safe to go ahead when so many dependencies are being removed? Why is it prompting for removal of these dependencies?



Aptitude is very broken on 64-bit Ubuntu at the moment. This is due to the fact that it doesn't handle Multiarch. If this is your case, i.e. if you are running 64-bit, please just use apt-get instead for a while.


That's because you currently have openjdk-6 installed, with ancillary third party libraries, and Sun (now Oracle)'s package wants to have its own versions of these libraries.

Suggest you read carefully the following on Oracle's Java 6 and then sudo update-alternatives --config java to update your Java alternatives - see here for the full community documentation on Java options available to you.

I would follow the community documentation directions and not do aptitude install sun-java6-jdk.

EDIT: have just seen OVC's answer and would try his/her suggestion first :-)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.