How To Install Sun Java SE 6 JDK and NetBeans 5.5.1 on Fedora 7 - Page 2

3 Making Sun JDK The Default Java Engine

To make freshly installed Sun JDK your default Java engine in the terminal windows issue the following commands:

First, become root:

su

Then add freshly installed Sun JDK to the list od Java alternatives:

/usr/sbin/alternatives --install /usr/bin/java java /usr/java/latest/bin/java 2

Finally, select freshly installed JDK as your default Java engine (in my case choice 2):

/usr/sbin/alternatives --config java

After this step both java and javac should be accessible and default Java selections. Please check this by issuing the following commands in your terminal.

To check Java engine:

java -version

To check Java compiler:

javac -version

Sun Java SE 6 JDK and NetBeans 5.5.1 on Fedora 7 - Pic5

4 Plugin Setup for Mozilla Firefox

To install Sun Java plugin into Fedora's Firefox setup issue the following commands.

First, become root:

su

Move to Mozilla Firefox plugin folder:

cd /usr/lib/mozilla/plugins

Create a symbolic link to Sun Java plugin:

ln -s /usr/java/latest/jre/plugin/i386/ns7/libjavaplugin_oji.so

Sun Java SE 6 JDK and NetBeans 5.5.1 on Fedora 7 - Pic7

After this step you should be able to verify that Sun's Java plugin is correctly installed. From withing Mozilla Firefox program go to the page about:plugins.

Sun Java SE 6 JDK and NetBeans 5.5.1 on Fedora 7 -Pic8

5 Downloading and installing Java SE 6 Documentation

Again, go to Sun's Java SE Downloads page and download latest Java SE 6 Documentation.

Click on Donwload button, then select Accept License Agreement, and check the box next to English version to donwload ZIP file (jdk-6-doc.zip). Save file under /home/tomo/Desktop folder

Sun Java SE 6 JDK and NetBeans 5.5.1 on Fedora 7 - Pic9

Assuming that the file has been downloaded to your desktop folder (in my case /home/tomo/Desktop) open your terminal window and execute following commands.

To become root:

su

To move Java SE 6 Documentation ZIP file to the folder when your JDK has been installed:

mv jdk-6-doc.zip /usr/java/latest/jdk-6-doc.zip

This step will enable use of the documentation from within NetBeans.

Share this page:

5 Comment(s)

Add comment

Comments

From: Anonymous at: 2010-03-10 09:09:20

I have got an error during installing error is "can not execute binary file" please send me how to remove error

From: at: 2008-03-05 10:01:21

The path /usr/java/latest/bin/java should actually point to where java was extracted. So, if you extract java to: /usr/jre<version>, then that command should be:

/usr/sbin/alternatives --install /usr/bin/java java /usr/jre<version>/bin/java 2

If you simply copy and paste what's existing, then you'll get problems when you go:

which java

It'll complain that it can't find java in the path, like so:

[root@localhost ~]# java -version
-bash: /usr/bin/java: No such file or directory

And:

[root@localhost ~]# which java
/usr/bin/which: no java in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

From: Paul Ryan at: 2009-08-23 23:36:02

Thanks for the excellent HOWTO. Fit my need perfectly.

From: Paula Martinez at: 2009-10-06 21:25:59

thanks for the howto
you can't imagine how much problems i had to install java...

From: Anonymous at: 2010-06-15 05:44:51

Thanks, the howto is really excellent and solved lots of problems in installing netbeans..