Recently during the study of Linux to find a lot of information to configure the success of the Linux environment variable configuration now record
System Environment VMware readhat5.5 version
jdk1.6 I'm using a jdk-6u45-linux-x64.bin bag.
First copy the JDK bin package to the virtual machine system. I put it in the/home/wangs/directory.
Unpack the bin package using the./jdk-6u45-linux-x64.bin command
Create java.sh scripts in the system's/ETC/PROFILE.D directory touch java.sh; Edit Script VI java.sh
Export Java_home=/home/wangs/jdk-6u45-linux-x64 (this path is configured with the path of the extracted folder)
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib
Assigning execute permissions to Java scripts chmod 777 java.sh
Execute environment variable script java.sh source java.sh (Note: This configuration can only run once when the script runs multiple times and the environment variable multiple configuration occurs)
Finally java-version to see if the configuration was successful
After this method is configured successfully, the environment variable also exists after restarting the virtual machine
Virtual machine Linux Java environment variable setting readhat system