Install Oracle JDK 7 on Ubuntu 12.04

    Greetings to all updated and those who are planning.

    As many of you know, proprietary Java has been cut out from official repositories.
    Instead, users were offered to use OpenJDK .
    However, there are serious problems with the stability of the latter.
    But first things first ...

    Today, installing the brand new proxmox 2.1 on the server, I found that after updating
    my system, the KVM console does not work for me.
    I quickly realized that I needed to put jre and got into the terminal and without thinking twice, I
    installed openjdk-6-jdk with icedtea-6-plugin for applets to work.

    I restart the browser, go to the tab of the proxmox web-muzzle, launch the console.
    This actually ended, or rather, the set of dances started, because here is a partial list of
    problems that I encountered using both openjdk-6-jdk and openjdk-7-jdk :
    1) When closing the console window, Firefox lied down with it .
    2) Initialization of the applet occurs with 100% CPU utilization, at which moment the browser is blocked.
    It lasts quite a while, which is why it infuriates me very much.
    3) A bunch of proxmox pop-up errors.

    Admittedly, this was my first experience with OpenJDK and probably the last.
    Finally, I decided to install proprietary java, and climbed to terrorize Google, to
    tell how to do it with minimal losses.
    It turns out that some guys have already fussed in the network and made ppa.

    I was delighted, but it was not there.
    After proceeding step by step to the sudo apt-get install item ,
    apt gave me an error “Errors were encountered while processing: oracle-java7-installer”.
    I got into Google again and found how to cure it. In case someone gets caught, I give a link with a cure for this disease.

    I despaired of finding a solution on the network, so I decided to go the other way - a proven worker.
    Through simple manipulations, I managed to get everything to work, and the results pleasantly surprised me.
    In particular, problems with both performance and browser crash have disappeared.

    Essence



    So, we have 2 options, how to install, leaving the system clean.
    Before proceeding, I recommend that you clean the system from OpenJDK:
    sudo apt-get purge openjdk*
    

    This command will remove everything related to all versions of OpenJDK.

    Method number 1.

    A short and quick option (if you have x86_64),
    where the .deb package is already prepared by me in advance, is posted on the network, and it remains only to download and install it:

    1) Download the package .
    2) We execute 4 commands in the terminal:
    # Необходимо предварительно выполнить переход(команда cd) в директорию, 
    # куда производилась загрузка .rpm пакета.
    sudo dpkg -i jdk_1.7.004-1_amd64.deb
    mkdir -p ~/.mozilla/plugins
    ln -s /usr/java/jdk1.7.0_04/jre/lib/amd64/libjavaplugin_jni.so ~/.mozilla/plugins/
    ln -s /usr/java/jdk1.7.0_04/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
    


    3) We restart the browser and enjoy the time saved.
    Unless of course you have a 64-bit version of the pangolin.

    Method number 2, from start to finish.

    1) We go to the Java SE download site , and download the package (.rpm), according to our architecture:
    Linux x86 (32-bit)
    Linux x64 (64-bit)
    2) Install alien, in essence it is a package converter that repackages downloaded .rpm packages in
    the .deb format we need, with its tricks.
    sudo apt-get install alien
    

    3) We set the "alien" on the downloaded rpm.
    sudo alien jdk-7u4-linux-x64.rpm --scripts
    

    At this stage, a .deb package will be generated in the same directory.
    4) Further on the thumb, we install the package, create symlinks and enjoy life.
    sudo dpkg -i jdk_1.7.004-1_amd64.deb
    mkdir -p ~/.mozilla/plugins
    ln -s /usr/java/jdk1.7.0_04/jre/lib/amd64/libjavaplugin_jni.so ~/.mozilla/plugins/
    ln -s /usr/java/jdk1.7.0_04/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
    


    I’ll make a reservation
    right away that I am not guilty of the fact that OpenJDK is to blame, but the experiments were performed on the freshly installed 12.04 and all problems were resolved after installing the proprietary version.

    Also popular now: