in /etc/profile, there this code for sh in /etc/profile.d/*.sh ; do if [ -r "$sh" ] ; then . "$sh" fi done unset sh /etc/zsh/zprofile does not have this. Thereforce my java vm was being set by the old way in env.d directory. This was preventing me from using java 1.5. I check the zprofile in the zsh files dir, and this code is not in there. I think it might need to be added, I read through the docs and didn't see anything about messing with the shell's profile.
*** This bug has been marked as a duplicate of 19924 ***