Results 1 to 10 of 10

Thread: HOWTO: Install the Java runtime environment

  1. #1
    Join Date
    Jul 2005
    Beans
    55

    HOWTO: Install the Java runtime environment

    As many of you have noticed, the Java runtime environment (JRE) is no longer available in backports. After complaining about this (I'm such a pathetic whiner!), I was informed that a utility called java-package could be used to create an appropriate JRE .deb package. I tried it and it worked, so I thought I'd write a quick HOWTO.

    It turns out that the java-package package is an extremely handy utility which takes a Java installer file from Sun and repackages it in a .deb file, quickly and painlessly, which can then be installed with dpkg. If it's not already installed on your system, install it:
    Code:
    sudo aptitude install java-package
    java-package depends on another package called fakeroot, which we'll see later. aptitude will install this automatically if need be.

    You'll need either the Java SDK (if you want to develop Java apps) or the JRE (if you just want to run existing Java apps). You can get the 5.0 version (which I used, as Azureus seems to want it) here or the 1.4.2 version here. The file you actually want is the Linux "self-extracting file" (in my example, jre-1_5_0_05-linux-i586.bin). Download this to some convenient location, then open a terminal session in that directory.
    Now, make sure you're not logged in as root when you do this. You'll get an error if you try this procedure as root. What you're going to do is run the make-jpkg command in a "fake root" environment created by the fakeroot command. This will keep Sun's installer script from messing with your real system configuration (it apparently likes to mess with stuff in /etc). The actual commands are quite simple. First:
    Code:
    fakeroot make-jpkg jre-1_5_0_05-linux-i586.bin
    Replace jre-1_5_0_05-linux-i586.bin with the name of the file you downloaded, if you didn't download the same package I did. Follow the prompts (agree to the license agreement, etc.), you'll see a lot of stuff spew across the screen, and at the end you should have a .deb file.

    The first time I tried this, I got a bunch of errors you get like, "dpkg-architecture: warning: Couldn't determine gcc system type, falling back to default (native compilation)." Turns out I didn't have gcc installed at all. sudo aptitude install build-essential will fix that.

    The end result is a file which, in my case, was called sun-j2re1.5_1.5.0+update05_i386.deb. So, the next step is to install it:
    Code:
    sudo dpkg -i sun-j2re1.5_1.5.0+update05_i386.deb
    At this point, Java should be installed. You can check it like this:
    Code:
    $ java -version
    java version "1.5.0_05"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
    And you're done! Now packages that depend on Java, like Azureus, will install correctly. Life is good.
    Last edited by pestie; October 3rd, 2005 at 10:58 PM.

  2. #2
    Join Date
    Sep 2005
    Beans
    150

    Re: HOWTO: Install the Java runtime environment

    I tried this.

    The package got built OK, it installed OK but it doesn't work!!!

    I find the only option is to install the .bin manually and then point to it via PATH or links.

    JonnyT

  3. #3
    Join Date
    Oct 2005
    Beans
    6

    Re: HOWTO: Install the Java runtime environment

    When I try this I get

    david@ubuntu:~$ fakeroot make-jpkg jre-1_5_0_05-linux-i586.bin
    /usr/bin/fakeroot: line 150: make-jpkg: command not found

  4. #4
    Join Date
    Sep 2005
    Beans
    463
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: HOWTO: Install the Java runtime environment

    Thanks for this very clearly written how to, works fine for a noob like me!

  5. #5
    Join Date
    Oct 2005
    Location
    Bama
    Beans
    37
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: HOWTO: Install the Java runtime environment

    I downloaded the 1.4 version and did everything but I came up with this error.

    zac851@linuxbox:~/Desktop$ fakeroot make-jpkg j2re-1_4_2_09-linux-i586.bin
    Creating temporary directory: /tmp/make-jpkg.XXXXtzql6o
    Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk.sh j2se.sh sun-j2re.sh sun-j2sdk.sh

    No matching plugin was found.
    Removing temporary directory: done

  6. #6
    Join Date
    Jul 2005
    Beans
    55

    Re: HOWTO: Install the Java runtime environment

    ngms27, what do you mean by "it doesn't work?" If the package installed correctly, java -version should show you what version of Java is installed. What's the error message you get instead?

    aetheist: That just looks like the java-package didn't install for some reason. Try sudo aptitude install java-package. If it says it's already installed, that's where things get weird.

    zac851: I didn't run into that myself, but this thread might help.

    NikoC: Thanks!

  7. #7
    Join Date
    Sep 2005
    Location
    Kingston, Ontario, Canada
    Beans
    8
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Install the Java runtime environment

    I ran through all this just fine, built and installed the Sun JDK, but gij is installed and "in the way":
    Code:
    mark@kiddo:~$ java -version
    java version "1.4.2"
    gij (GNU libgcj) version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
    Copyright (C) 2005 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    mark@kiddo:~$
    So I had to remove the gij and gij-4.0 packages. Now Sun's JDK is default:
    Code:
    mark@kiddo:~$ java -version
    java version "1.5.0_05"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
    mark@kiddo:~$
    Mark

  8. #8
    Join Date
    Oct 2005
    Location
    Greece, Athens
    Beans
    21

    Re: HOWTO: Install the Java runtime environment

    when I gave :fakeroot make-jpkg jre-1_5_0_05-linux-i586.bin

    Creating temporary directory: /tmp/make-jpkg.XXXX1IJiqm
    Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk.sh j2se.sh sun-j2re.sh sun-j2sdk.sh

    No matching plugin was found.
    Removing temporary directory: done


    what's the problem? I read the thread in http://ubuntuforums.org/showthread.php?t=40887
    but I can't understand, cause i'm a new user
    Last edited by silent_scream; October 4th, 2005 at 09:49 PM.

  9. #9
    Join Date
    Jul 2005
    Beans
    14
    Distro
    Edgy Eft Testing

    Re: HOWTO: Install the Java runtime environment

    For all who have problems with plugins...

    Check if you have "Java-common" package installed. That package is also required to make the java-package procedure work. If not just type in console:

    Code:
    sudo aptitude install java-common
    Then try to run the java-package again as Pestie explained.

  10. #10
    Join Date
    Feb 2005
    Beans
    Hidden!

    Re: HOWTO: Install the Java runtime environment

    This same trick has been posted before, so please continue it on the other thread.

    http://www.ubuntuforums.org/showthre...light=fakeroot
    Sylvia: Look at what you've done to him!
    Christof: I have given Truman the chance to lead a normal life. The world, the place you live in, is the sick place.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •