update userenv.sh with jdk settings and fix a bug.