FreeBSD Javaź Project: How To Install
When installing Java on FreeBSD you have the choice between different Java Development Kits:
OpenJDK on FreeBSD
This is a native port of OpenJDK to FreeBSD.
cd /usr/ports/java/openjdk6
make install clean
Oracle JDK on FreeBSD
This is the effort of the Java FreeBSD porting project. By the use of patchsets and the JDK source code released by Oracle, this port builds a native JDK for FreeBSD.
cd /usr/ports/java/jdk16
make install clean
Oracle JDK for Linux
This port installs the Java Development Kit from Oracle which was built for Linux. It will run under FreeBSD using the Linux compatibility.
cd /usr/ports/java/linux-sun-jdk16
make install clean
Note: Please note that due to the current licensing policy the Oracle JDK on FreeBSD binaries can not be distributed and you are only permitted to use them personally. Due to the same reasons you have to manually fetch the source code and patchset for FreeBSD.
If you should have trouble, you can see the FreeBSD Handbook section on "installing applications" for help.