the PATH depends on which user start httpd ie :
add export PATH=$PATH:/usr/java/j2sdk1.4.2_04/bin to your ~/.bashrc
create a infos.php file, put in it : <?php phpinfo(); ?>, place the file in your site directory
sudo /sbin/apachectl start
With a web browser go to
www.yoursite.com/infos.php
and look at the PATH indication, it should have /usr/java/j2sdk1.4.2_04/bin in it