PDA

View Full Version : {Ubuntu} Installing Java



Syronix
04-06-2010, 08:03 AM
I know it's a simple feat, yet when I first started using Linux I had so much trouble installing Java.

Alright I use Ubuntu 9.04 so I will be discussing how to install Java "succesfully"!

*note* I am going to try to use the terminal as little as possible.
*note* I will discuss installing the Linux RPM version of Java.
*note* I will be downloading all files /usr/java making it the directory I will use terminal to get to the files
*note* You don't have to download to /usr/java this is just what I do to maintain order

Start by going to the Java download page Here (http://www.java.com/en/download/linux_manual.jsp?locale=en&host=www.java.com:80)

Click on the Linux RPM(self-extracting file).

********* In this section I will cover using the Linux RPM file*********

(All after you have downloaded the file to /usr/java)

Step 1. Open the terminal and become the root-user with the su command
ex.
******************** At the terminal type -su- (without the dashes of course)
******************** After you hit enter it will ask for the root-user password enter it and then press enter, don't be alarmed no text of any kind is displayed in the terminal when you type in the password, it's all there just a security thing, after you have typed in the password hit enter you should now be the super-user (i.e. root-user)

Step 2. Change your directory to the directory in which you downloaded the java rpm package to (/usr/java)
ex.
******************** Use the -cd- (without the dashes of course) command to change your directory to /usr/java.
******************** I'll use my pc as an example -cd /usr/java
******************** Once I do this I am in the /usr/java directory

Step 3. You have to change the Permissions on your Java file to make it an executable by using the -chmod- command.
ex.
******************** In the Terminal type chmod a+x jre-6u<update-version>-linux-i586-rpm.bin
*note* In the <update-version> spot in the command insert the number on the name of the file such as on my latest java update the file was named --- jre-6u19-linux-i586-rpm.bin

Step 4. Ok as of now your file is ready to install !!HOORAYY!! Alright lets run this file
ex.
******************** Alright in the Terminal type --- ./jre-6u<update-version>-linux-i586-rpm.bin
******************** The license agreement is displayed enter yes to continue the installation
******************** The installation file makes and the file in the current directory /usr/java
******************** Now you want to verify that jre1.6.0_<update-version> subdirectory is listed under the current directory in Terminal type -- ls (without the dashes of course)

Step 5. Because this is an Ubuntu guide I will assume you are using firefox, in order to use java with firefox you will have to link to the libjavaplugin.so file.
ex.
******************** Enter this in Terminal -- cd /usr/lib/firefox-<update-version>/plugins
******************** After that enter this -- ln -s /usr/java/jre1.6.0_<update-version>/plugin/i386/ns7/libjavaplugin_oji.so

Step 6. Restart your firefox browser and type in the address bar about:plugins and search for the java plugin to confirm that it is loaded.

Once you confirm the plugin is loaded you will know that you have successfully completed your task of installing java congratulations.

If you have any questions post them or pm me.

*note* I apologize about the layout and everything this is my first tutorial ( I've never really posted on forums before) would love some feedback on how I did.

Wizzup?
04-06-2010, 08:20 AM
Why not install the one in the package manager?

sudo apt-get install icedtea6-plugin

Or you may prefer the sun package. See https://help.ubuntu.com/community/Java

Syronix
04-06-2010, 05:11 PM
Why not install the one in the package manager?

sudo apt-get install icedtea6-plugin

Or you may prefer the sun package. See https://help.ubuntu.com/community/Java

By doing it manually through terminal I'm hoping to give people confidence with the terminal as it's an essential part of linux. But you are correct it is way easier just to use package manager.

Nava2
04-06-2010, 07:23 PM
There is also the sunjava6-plugin if you would rather something directly from the publisher.

Wizzup?
04-06-2010, 09:56 PM
There is also the sunjava6-plugin if you would rather something directly from the publisher.

Ah, it wasn't available for me on 64 bit.

Btw, it isn't just easier to use the package manager, it is also a good way to keep your system clean and up to date.

Nava2
04-06-2010, 10:34 PM
sun-java6-plugin*

Is what I meant.

I have it available in synaptic, on x86_64.

Wizzup?
04-06-2010, 11:35 PM
sun-java6-plugin*

Is what I meant.

I have it available in synaptic, on x86_64.

'Sorry, 'Sun Java 6.0 Plugin' is not available for this type of computer (amd64).