Thứ Bảy, tháng 6 01, 2013

How to install jdk 7 when install failed ?

When I fresh install Linux Mint 14 KDE, all the suddent I couldn't install Java (sha256sum mismatch jdk-7u3-linux-x64.tar.gz), which means I can't do much deving. Well I searched through the interweb and finally found a solution.

First:

sudo add-apt-repository ppa:eugenesan/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

By now, you have probably gotten an error and the terminal has stated that Java was not installed. No problem.

Second:

Download Java directly from Oracle

Now, move what you just downloaded to /var/cache/oracle-java7-installer/

Third:

sudo gedit /var/lib/dpkg/info/oracle-java7-installer.postinst

Now scroll down and find the following:

                
                echo "Downloading..."
                rm -f $FILENAME
                WGETRC=wgetrc wget $PARTNER_URL 
                        || fp_exit_with_error "download failed"
                rm -f wgetrc
                echo "Download done."

Now put a # next to each line between "Downloading..." and "Downloading done."

     
               
                echo "Downloading..."
                #rm -f $FILENAME
                #WGETRC=wgetrc wget $PARTNER_URL 
                        #|| fp_exit_with_error "download failed"
                #rm -f wgetrc
                echo "Download done."

Save, and go back to your terminal.

Finally, do:

sudo apt-get install oracle-java7-installer

Java should now install properly.

Source:

http://www.ubuntugee...untu-12-04.html (most helpful info is in the comments)