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

Want to support HowtoForge? Become a subscriber!
 
Submitted by tpop2005 (Contact Author) (Forums) on Wed, 2007-08-15 19:29. ::

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.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by harlequin (registered user) on Wed, 2008-03-05 11:01.

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)