Announcement

Collapse
No announcement yet.

FAQ: Java Kubuntu

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FAQ: Java Kubuntu

    Earlier:

    - http://www.kubuntuforums.net/showthr...artner-archive

    - http://www.kubuntuforums.net/showthr...-on-2012-02-16

    ...
    If you are currently using the Oracle Java packages from the partner
    archive, you have two options:

    1- Install the OpenJDK packages that are provided in the main Ubuntu
    archive. (icedtea6-plugin for the browser plugin, openjdk-6-jdk or
    openjdk-6-jre for the virtual machine)
    2- Manually install Oracle's Java software from their web site [4].
    ...
    [4] - http://www.oracle.com/technetwork/ja...ads/index.html

    How - Oracle Java

    - http://askubuntu.com/questions/tagged/java

    - http://askubuntu.com/questions/48468...o-install-java

    - http://askubuntu.com/questions/67909...cle-java-jdk-6
    Have you tried ?

    - How to Ask a Question on the Internet and Get It Answered
    - How To Ask Questions The Smart Way

    #2
    Example

    With the Kubuntu 12.04 (alpha2), i386.


    Browsing to the http://www.oracle.com/technetwork/ja...ads/index.html .

    Picking the Java SE 6 Update 30 & Java SE 7u2, JRE.

    You must accept the Oracle Binary Code License Agreement for Java SE to download this software.
    Accepting...
    Thank you for accepting the Oracle Binary Code License Agreement for Java SE; you may now download this software.


    Picking the right poison: jre-6u30-linux-i586.bin & jre-7u2-linux-i586.tar.gz.

    The bin is a self extracting archive. It need to marked as an executable. Right click with the file manager > Properties > Permissions > is executable.



    Executing it with the command:
    Code:
    ./jre-6u30-linux-i586.bin
    Log of ./jre-6u30-linux-i586.bin
    Sat Feb 4 14:50:57 2012

    Unpacking...
    Checksumming...
    Extracting...
    UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
    creating: jre1.6.0_30/
    creating: jre1.6.0_30/bin/
    inflating: jre1.6.0_30/bin/java
    ...
    Creating jre1.6.0_30/lib/plugin.jar
    Creating jre1.6.0_30/lib/javaws.jar
    Creating jre1.6.0_30/lib/deploy.jar

    Done.
    There is the folder: jre1.6.0_30.

    The jre-7u2-linux-i586.tar.gz is a tar archive and can be extracted from the file manager. Right click it > Extract > Extract Archive Here, Autodetect Subfolder.

    There is folder: jre1.7.0_02.


    Renaming the folders:

    jre1.6.0_30 -> java-6-oraclejre
    jre1.7.0_02 -> java-7-oraclejre

    Moving them to the /usr/lib/jvm/ (kdesudo dolphin).

    Last edited by OneLine; Feb 04, 2012, 02:51 PM.
    Have you tried ?

    - How to Ask a Question on the Internet and Get It Answered
    - How To Ask Questions The Smart Way

    Comment


      #3
      Alternatives

      man update-alternatives:
      NAME
      update-alternatives - maintain symbolic links determining default commands

      SYNOPSIS
      update-alternatives [option...] command

      DESCRIPTION
      update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system.

      It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time...

      Adding

      Adding the Oracle javas to the alternative system:

      Java 6 -
      Code:
      sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-6-oraclejre/bin/java 20
      Java 7 -
      Code:
      sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-oraclejre/bin/java 20

      There are:
      Code:
      update-alternatives --list java
      /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java
      /usr/lib/jvm/java-6-oraclejre/bin/java
      /usr/lib/jvm/java-7-oraclejre/bin/java

      KDE System Settings module: kalternatives
      Description-en: graphical alternatives system configuration tool
      Kalternatives offers a GUI to configure the alternative systems (a
      system that allows you to select one alternative file for many in the
      filesystem).
      Kalternatives is available as KDE configuration module, integrated by default
      into KDE's System Settings.
      .
      This is an advanced GUI of the update-alternatives program shipped with dpkg.



      With the default, OpenJDK:
      Code:
      java -version
      java version "1.6.0_24"
      OpenJDK Runtime Environment (IcedTea6 1.11) (6b24-1.11-0ubuntu1)
      OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
      Turning the Oracle Java-6 on:
      Code:
      sudo update-alternatives --config java
      There are 3 choices for the alternative java (providing /usr/bin/java).

      Selection Path Priority Status
      ------------------------------------------------------------
      * 0 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 auto mode
      1 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 manual mode
      2 /usr/lib/jvm/java-6-oraclejre/bin/java 20 manual mode
      3 /usr/lib/jvm/java-7-oraclejre/bin/java 20 manual mode

      Press enter to keep the current choice[*], or type selection number: 2
      update-alternatives: using /usr/lib/jvm/java-6-oraclejre/bin/java to provide /usr/bin/java (java) in manual mode.
      The Java is telling:
      Code:
      java -version
      java version "1.6.0_30"
      Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
      Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)

      Turning the Oracle Java-7 on:
      Code:
      sudo update-alternatives --config java
      There are 3 choices for the alternative java (providing /usr/bin/java).

      Selection Path Priority Status
      ------------------------------------------------------------
      0 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 auto mode
      1 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1061 manual mode
      * 2 /usr/lib/jvm/java-6-oraclejre/bin/java 20 manual mode
      3 /usr/lib/jvm/java-7-oraclejre/bin/java 20 manual mode

      Press enter to keep the current choice[*], or type selection number: 3
      update-alternatives: using /usr/lib/jvm/java-7-oraclejre/bin/java to provide /usr/bin/java (java) in manual mode.
      The Java is telling:
      Code:
      java -version
      java version "1.7.0_02"
      Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
      Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode)

      Removal

      Removing the Oracle Java 6 from the alternatives:
      Code:
      sudo update-alternatives --remove java /usr/lib/jvm/java-6-oraclejre/bin/java
      and there are available:
      Code:
      update-alternatives --list java
      /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java
      /usr/lib/jvm/java-7-oraclejre/bin/java
      The installed Java 6, /usr/lib/jvm/java-6-oraclejre/, can be removed.
      Last edited by OneLine; Feb 04, 2012, 02:16 PM.
      Have you tried ?

      - How to Ask a Question on the Internet and Get It Answered
      - How To Ask Questions The Smart Way

      Comment


        #4
        Browser java plugin

        Using the Opera.

        Opera: http://www.opera.com/docs/linux/plugins/install/
        Oracle: http://www.oracle.com/technetwork/ja...ux-136395.html

        Locating the Oracle Java plugin:
        Code:
        locate libnpjp2.so
        /usr/lib/jvm/java-6-oraclejre/lib/i386/libnpjp2.so
        /usr/lib/jvm/java-7-oraclejre/lib/i386/libnpjp2.so
        Opening the file manager (kdesudo dolphin) to the /usr/lib/opera/plugins/ & /usr/lib/jvm/java-7-oraclejre/lib/i386/. Drag&dropping&linking the libnpjp2.so plugin to the /usr/lib/opera/plugins/.



        Starting the Opera and testing the Java on http://java.com/en/download/testjava.jsp.



        Seems to work.


        Note !

        I changed the libnpjp2.so plugin status to executable. It was not, when extracted from the jre-7u2-linux-i586.tar.gz.
        Last edited by OneLine; Feb 04, 2012, 02:55 PM.
        Have you tried ?

        - How to Ask a Question on the Internet and Get It Answered
        - How To Ask Questions The Smart Way

        Comment

        Working...
        X