What distribution are you using? Did you attempt to install java with your distros package management tool ? For a standard java install do the following. This is how I do it by no means is it the best or only way.
As root or use sudo
chown -R username:group /usr/java
Become regular user again.
download the j2sdk from sun.
Just get the sdk not the netbeans one.
Under the heading
Download J2SE v 1.4.2_03
32-bit/64-bit for Windows/Linux/Solaris SPARC32-bit for Solaris x86
Once you accept the license you will be taken to the actual download page where you should select self-extracting file (j2sdk-1_4_2_03-linux-i586.bin, 34.16 MB)
not the rpm version. once that file is downloaded
chmod 755 j2sdk-1_4_2_03-linux-i586.bin
cp j2sdk-1_4_2_03-linux-i586.bin /usr/java/
ln -s /usr/java/j2sdk1.4.2_03 j2sdk
edit your .bash_profile or .profile or .bashrc or .tcshrc or whatever your shells evn script is and add or edit the following
This is all from memory so dont try and cut and paste all these command but it should be close.
as for the plug in make a simlik (it must be a simlink) form
ln -s $JAVA_HOME/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so ~/.mozilla/plugins/