Find the answer to your Linux question:
Results 1 to 10 of 10
People forget that newbies need step by step "detailed instructions" when they ask for help. I'm attempting to get some simple instructions on how to install Java on a Ubuntu ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2006
    Location
    Sydney, Australia.
    Posts
    7

    Java on Ubuntu


    People forget that newbies need step by step "detailed instructions" when they ask for help.
    I'm attempting to get some simple instructions on how to install Java on a Ubuntu OS.
    An example of the inadequate replies I get follows.:----
    To an experienced Linux user these instructions may seem straight forward, but they are not.
    Go to http://java.sun.com/j2se/1.5.0/download.jsp and click on “Download JRE 5.0 Update 4”. Ensure you do not choose the link with the NetBeans bundle.

    You must first accept the licence, then click on “Linux self-extracting file” (sun-j2re1.5_1.5.0+update04_i386). Save this file to your hard drive.

    Make the downloaded file executable. At the command line, change to the directory where you downloaded the file, and type

    chmod +x sun-j2re1.5_1.5.0+update04_i386.bin
    I've underlined what I consider incomplete instructions.
    My question is,> how do I make the file executable and secondly,..how do I change to the directory where I downloaded the file???
    The instructions assume I know how to do these two things, but I do not.
    After all,... isn't that why I'm asking for this info. I'm a total novice and need simple step by step instructions which omit nothing.
    Most instructions leave out the crucial points that I need.
    It really drives me nutso.

  2. #2
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by felixq78
    Make the downloaded file executable. At the command line, change to the directory where you downloaded the file, and type

    chmod +x sun-j2re1.5_1.5.0+update04_i386.bin
    I've underlined what I consider incomplete instructions.
    My question is,> how do I make the file executable and secondly,..how do I change to the directory where I downloaded the file???
    You've actually already answered one of your questions. The chmod +x command makes the file executable. If you've run that command, you're good.

    To change directories in command-line Linux you use the cd command, just like you would in Microsoft DOS. You'll need to know the directory into which you want to move, so to list the contents of the directory you're currently inside, use ls (that's lowercase LS, not 1S or IS). For example:

    Code:
    ls <enter>
    OUTPUT: directory1 directory2 file1 file2
    cd directory1 <enter>
    It's likely that when you downloaded the file it got put into your /home/ directory by default, and that's usually where Linux plops you down when you open a command line interface, so you probably won't have to worry about changing directories anyway. If the file is inside your current directory, you will see it when you issue the ls command.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  3. #3
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    339
    Quote Originally Posted by felixq78
    People forget that newbies need step by step "detailed instructions" when they ask for help.
    Don't you forget that the ones who give you the information think they have helped you. A simple request for more would have got the same response from techieMoe.
    Pete

  4. #4
    Linux Guru antidrugue's Avatar
    Join Date
    Oct 2005
    Location
    Montreal, Canada
    Posts
    3,211
    Installing Java on Ubuntu is much simpler :
    Code:
    sudo apt-get install sun-java6-jre sun-java6-plugin
    That's it.

    No downloading of .bin files, no chmod, just plain simple.
    "To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."

    -Bruce Lee

  5. #5
    Linux User zba78's Avatar
    Join Date
    Feb 2004
    Location
    Birmingham, England
    Posts
    335
    ok lets give this a shot:

    - Put the file you have downloaded into your home directory
    - Then open your home directory by going to the places menu and select home
    - This will open a file browser and you should see the downloaded file (sun-j2re1.5_1.5.0+update04_i386.bin)
    - Right-click on the file and select proporties from the bottom
    - Go accross to the permissions tab and tick the box that says Allow executing file as program
    - Click the close button
    - Now open the gnome-terminal (Applications Menu --> Accesories)
    - Gnome-Terminal will automatically open at your home directory so don't worry about cd command
    - Now just type in the command sudo ./sun-j2re1.5_1.5.0+update04_i386.bin

    This should install java for you
    Ubuntu Jaunty :: Arch Linux (current) :: Acer Aspire 1692WMLi

  6. #6
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    The solution given by antidrugue is much more elegant. I'd recommend that one above all others, including mine. The chmod/sh version will work with any distribution, but Ubuntu (and its parent distribution Debian) makes certain things much easier.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  7. #7
    Just Joined!
    Join Date
    Mar 2007
    Posts
    3

    Talking Package managers

    Yep, I had all those problems. I went back to Synaptic after working out what "multiverse" etc. all means and installed it via the package manager, and got the Eclipse IDE running nicely too.
    There are some instructions somewhere about fiddling with the repositories but being young and feckless I have now forgotten where I found em.
    I should add a warning. In the process of doing all this I mistakenly loaded some kernel packages and my linux starts up as XUBUNTU instead of UBUNTU. It still closes down as UBUNTU which is weird but, ho hum. I doubt you will have the same problem. I do have a reputation for interfering with things that ought to be left alone.
    Last edited by RobertG; 03-08-2007 at 07:38 AM. Reason: Typo - Xubuntu not Kubuntu

  8. #8
    Linux Enthusiast flipjargendy's Avatar
    Join Date
    Aug 2004
    Location
    Xanadu, Titan, Saturn
    Posts
    612
    Quote Originally Posted by antidrugue
    Installing Java on Ubuntu is much simpler :
    Code:
    sudo apt-get install sun-java6-jre sun-java6-plugin
    That's it.

    No downloading of .bin files, no chmod, just plain simple.

    That is exaclty what i was going to reply with.... that is the best way to go. 'Apt-get' will normally get it installed the best way.
    Running Linux Since 2001
    Registered Linux User #430868 - Since 91206

  9. #9
    Linux Guru bryansmith's Avatar
    Join Date
    Nov 2004
    Location
    /Ontario/Canada
    Posts
    2,619
    Java 6 is only in backports. If you don't want to use backports, you can still easily install Java 5. Simply replace the 6 with a 5 in the apt command that antidrugue provided:
    Code:
    sudo apt-get install sun-java5-jre sun-java5-plugin
    Looking for a distro? Look here.
    "There can be no doubt that all our knowledge begins with experience." - Immanuel Kant (Critique of Pure Reason)
    Queen's University - Arts and Science 2008 (Sociology)
    Registered Linux User #386147.

  10. #10
    Linux User zba78's Avatar
    Join Date
    Feb 2004
    Location
    Birmingham, England
    Posts
    335
    Quote Originally Posted by techieMoe
    The solution given by antidrugue is much more elegant. I'd recommend that one above all others, including mine. The chmod/sh version will work with any distribution, but Ubuntu (and its parent distribution Debian) makes certain things much easier.
    Couldn't agree more.

    I feel a bit of a fool actually considering I installed Java via apt-get myself (using synaptic to be exact) so I have no idea why I went off on one

    I can only apologise.
    Ubuntu Jaunty :: Arch Linux (current) :: Acer Aspire 1692WMLi

Posting Permissions

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