My question is where most of the build occurs ?/tmp and how big should I make the directory to compile jdk 1.5, mplayer-codecs, libdvdcss?

Issuing the following:

$df -h

...will help you pinpoint errant partition sizes.

If you are not changing the locations of where the ports tree builds applications, all versions of the JDK are primarily built underneath /usr/ports/devel/jdk & /usr/ports/obj, however, there are dependencies which will be built throughout the tree. Personally, I allocate 35-50GB as a single partition mounted as /usr/ports, but this is (intentionally) larger than what I ever need, but at times I build very large applications -- OpenOffice, etc., so I don't want to run into the situation you are experiencing now. 35GB is usually enough for everything, but I sometimes allocate more if I have the disk space to spare.

Cleaning object file & distfiles after building all applications can help if disk space is at a premium.

Likewise, note that only JDK versions prior to 1.7 require building as JDK 1.7 is available as a package as discussed in Section 8.3 of the FAQ.

While 1.7 is available as a package, 1.7 has no Mozilla plug-in for its associated JRE. So for those who want applets in a browser, 1.5 is the right way to go. If 1.6 is needed, 1.5 is a build dependency.

(Note that for subsequent update builds, the admin can use FLAVOR=native_bootstrap and reduce the length of time and some of the huge disk space demands for building Java.)