Type java --version to make sure you have v1.5 or better (1.6 here)
You may have to set JAVA_HOME, but I can't remember.
You could try adding export JAVA_HOME=/usr/local/dh/java to .bashrc and add . ~/.bashrc to .bash_profile
Maximum Cash Discount on any plan with MAXCASH
How To Install PHP.INI / ionCube on DreamHost