I have installed sun-java in archlinux kde by first building the package and then installing it. This is the way the environment variables are set in my machine: file: /etc/profile # /etc/profile
#Set our umask umask 022 # Set our default path PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" export PATH # Load profiles from /etc/profile.d if test -d /etc/profile.d/; then for profile in /etc/profile.d/*.sh; do test -r "$profile" && . "$profile" done unset profile fi # Source global bash config if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then . /etc/bash.bashrc fi # Termcap is outdated, old, and crusty, kill it. unset TERMCAP # Man is much better than us at figuring this out unset MANPATH
and file: /etc/profile.d/jdk.sh
export J2SDKDIR=/opt/java export PATH=$PATH:/opt/java/bin:/opt/java/db/bin export JAVA_HOME=/opt/java export DERBY_HOME=/opt/java/db
what I understand from this is, jdk path should be set in the path environment variable but its not. But the attribute $JAVA_HOME is set correctly. Any reasons why am I facing this problem?
preguntado el 03 de mayo de 12 a las 20:05
/etc/profile and /etc/profile.d are processed only for login shells, so unless you're doing ssh into the machine where java is installed you won't get those variables.
To have them localmente (e.g. when you open an xterm on a workstation) put them in the file /etc/bash.bashrc.
Espero que esto ayude.
Actually, it was a silly mistake on my part. I am using zsh shell. So I was required to put:
in .zshrc file instead of .bashrc.