I saw these instructions in a book and don't know what the . /etc/profile
command does, what is it?
Is it the same as source /etc/profile
?
Linux-specific Java steps
On Linux systems, the following instructions set up a bash file in the
/etc/profile.d/
directory that definesJAVA_HOME
for all users. Changing environmental settings in this folder requires root access and affects all users of the system. (We’re using$
as the bash shell prompt.) The Oracle JVM installer typically installs the software in/usr/java/ jdk-1.6.X
(for v1.6) and it creates sym-links from/usr/java/default
and/usr/java/latest
to the installation:$ /usr/java/latest/bin/java -version java version "1.6.0_23" Java(TM) SE Runtime Environment (build 1.6.0_23-b05) Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode) $ sudo echo "export JAVA_HOME=/usr/java/latest" > /etc/profile.d/java.sh $ sudo echo "PATH=$PATH:$JAVA_HOME/bin" >> /etc/profile.d/java.sh $ . /etc/profile $ echo $JAVA_HOME /usr/java/latest