In my case, I had jdk1.6.0_16 extracted in my home directory and had a symbolic links to java and /javac in /bin. Then I encountered the error described above in the question.
However once I included a symbolic link to jar in /bin, the shell script to install Java EE ran as expected.