I am installing sun-java6-jre on ubuntu 12.04, but I am getting the following error,
The following packages have unmet dependencies:
sun-java6-jdk : Depends: sun-java6-bin (= 6-06-0ubuntu1) but it is not going to be installed
sun-java6-jre : Depends: sun-java6-bin (>= 6.30-2~precise1) but it is not going to be installed or
ia32-sun-java6-bin (>= 6.30-2~precise1) but it is not going to be installed
Recommends: gsfonts-x11 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Please help!
Sun Java is no longer available for Ubuntu in this way.
Will
sudo apt-get install openjdk-6-jdk
be good enough for what you need?
You may follow this detailed procedure:
Refer:
http://www.oracle.com/technetwork/java/javase/downloads/index.html http://hendrelouw73.wordpress.com/2012/06/01/how-to-install-oracle-java-6-0-32-on-ubuntu-12-04-linux/
Download:
Download following files from http://www.oracle.com/technetwork/java/javase/downloads/index.html JDK: jdk-6u37-linux-i586.bin (or jdk-6u37-linux-x64.bin for 64 bit system) JRE: jre-6u37-linux-i586.bin
Installation Procedure:
Make sure the installation folder exists:
$ sudo mkdir -p /usr/lib/jvm
cd to folder containing jre and jdk bin files
Move the downloaded files to installation folder
$ sudo mv jdk-6u37-linux-i586.bin /usr/lib/jvm
$ sudo mv jdk-6u37-linux-x64.bin /usr/lib/jvm (for 64 bit system)
$ sudo mv jre-6u37-linux-i586.bin /usr/lib/jvm (only if, you are installing just JRE)
$ cd /usr/lib/jvm
Make the downloaded binaries executable
$ sudo chmod u+x jdk-6u37-linux-i586.bin
$ sudo chmod u+x jre-6u37-linux-i586.bin (only if, you are installing just JRE)
Extract both compressed binary files:
$ sudo ./jdk-6u37-linux-i586.bin
$ sudo ./jre-6u37-linux-i586.bin (only if, you are installing just JRE)
Inform Ubuntu where your Java installation is located
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_37/bin/javac" 1
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_37/jre/bin/java" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_37/bin/javaws" 1
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.6.0_37/bin/java" 1 (only if, you are installing just JRE)
Inform Ubuntu that this is you default Java installation:
$ sudo update-alternatives --set javac /usr/lib/jvm/jdk1.6.0_37/bin/javac
$ sudo update-alternatives --set java /usr/lib/jvm/jdk1.6.0_37/jre/bin/java
$ sudo update-alternatives --set javaws /usr/lib/jvm/jdk1.6.0_37/bin/javaws
$ sudo update-alternatives --set java /usr/lib/jvm/jre1.6.0_37/bin/java (only if, you are installing just JRE)
Reload your system-wide PATH
$ . /etc/profile
Reboot you Ubuntu system Checking versions:
$ java -version
$ javac -version
$ javaws -version
You should be able to see:
java version "1.6.0_37" javac 1.6.0_37
Setting JAVA_HOME:
Add following code to ~/.bashrc file:
# Setting JAVA_HOME manually
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_37
export PATH=$PATH:$JAVA_HOME
Now, open a new terminal:
$ echo $JAVA_HOME
=> /usr/lib/jvm/jdk1.6.0_37/bin
Installation and Registration of Java Plugin for Linux:
Refer: http://www.oracle.com/technetwork/java/javase/manual-plugin-install-linux-136395.html When you install the Java platform, the Java plugin file is included as part of that install. If you want to use Java within Firefox, you need to manually create a symbolic link from the plugin file in the release to one of the locations that Firefox expects. You can create the symbolic link in your home directory, in ~/.mozilla/plugins. The plugin file for Linux is located here: /lib/i386/libnpjp2.so
To install the Java Plugin follow these steps:
Uninstall any previous installations of Java Plugin. Only one Java Plugin can be used at a time. When you want to use a different plugin, or version of a plugin, remove the symbolic links to any other versions and create a fresh symbolic link to the new one. Remove the existing symbolic links (or move them to another directory):
$ rm libnpj*
Create a symbolic link to the Java Plugin in the Firefox plugins directory.
$ ln -s /usr/lib/jvm/jdk1.6.0_37/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/
$ ln -s /usr/lib/jvm/jdk1.6.0_37/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/ (in case for 64 bit system)
$ ln -s /usr/lib/jvm/jre1.6.0_37/lib/i386/libnpjp2.so ~/.mozilla/plugins/ (only if, you are installing just JRE)
Start the Firefox browser . Testing installed plugin: Type about:plugins in the Location bar to confirm that the Java Plugin is loaded. You can also click the Tools menu to confirm that Java Console is there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With