Installing sun-java6-jre gives an error

I install sun-java6-jre on ubuntu 12.04, but I get 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!

+6
source share
3 answers

Sun Java is no longer available for Ubuntu.

Will

 sudo apt-get install openjdk-6-jdk 

be good enough for what you need?

+3
source

You can follow this detailed procedure:

Contact:

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 the 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 a folder containing jre and jdk bin files

  • Move the downloaded files to the installation folder

    $ sudo mv jdk-6u37-linux-i586.bin / usr / lib / jvm

    $ sudo mv jdk-6u37-linux-x64.bin / usr / lib / jvm (for a 64-bit system)

    $ sudo mv jre-6u37-linux-i586.bin / usr / lib / jvm (only if you install only JRE)

  • $ cd /usr/lib/jvm

  • Make executable file downloaded executables

    $ sudo chmod u + x jdk-6u37-linux-i586.bin

    $ sudo chmod u + x jre-6u37-linux-i586.bin (only if you install only JRE)

  • Extract compressed binaries:

    $ sudo. / jdk-6u37-linux-i586.bin

    $ sudo. / jre-6u37-linux-i586.bin (only if you install only JRE)

  • Tell 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 install only JRE)

  • Tell Ubuntu that you install Java by default:

    $ 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 install only JRE)

  • Reboot system-wide PATH

    $. / etc / profile

  • Reboot Ubuntu Versioning:

    $ java -version

    $ javac -version

    $ javaws -version

You should be able to see:

java version "1.6.0_37" javac 1.6.0_37

JAVA_HOME setting:

Add the following code to the ~ / .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 

Installing and registering the Java plugin for Linux:

Refer to: http://www.oracle.com/technetwork/java/javase/manual-plugin-install-linux-136395.html When you install the Java platform, the Java plug-in file is included as part of this installation. If you want to use Java in Firefox, you need to manually create a symbolic link from the plugin file in the release to one of the places that Firefox expects. You can create a symbolic link in your home directory under ~ / .mozilla / plugins. The Linux plugin file is here: /lib/i386/libnpjp2.so

To install the Java plugin, follow these steps:

  • Exit Firefox.
  • $ cd ~ / .mozilla / plugins /
  • Uninstall all previous Java Plugin installations. Only one Java plugin can be used at a time. If you want to use another plugin or version of the plugin, delete the symbolic links with any other versions and create a new symbolic link to the new one. Delete existing symbolic links (or move them to another directory):

    $ rm libnpj *

  • Create a symbolic link to the Java plugin in the Firefox plugin 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 the case of a 64-bit system)

    $ ln -s / usr / lib / jvm / jre1.6.0_37 / lib / i386 / libnpjp2.so ~ / .mozilla / plugins / (only if you install only JRE)

  • Launch the Firefox browser. Testing the installed plugin: Enter around: plugins in the location bar to confirm the loading of the Java plugin. You can also click the Tools menu to confirm that there is a Java console.

+1
source
  • Open a terminal.

  • Run the command: sudo synaptic

  • Search for the Sun JDK package.

  • Check the box to install and apply the changes.

0
source

Source: https://habr.com/ru/post/920139/


All Articles