Fedora Linux 8 system JDK 6.0 configuration method

  

1, login sun.com download the latest JDK, I am under jdk-6u5-linux-i586-rpm.bin that is saved in the directory "~/" under.


2. Since the bin file does not have executable permissions, execute the command at the terminal: chmod 777 ~/jdk-6u5-linux-i586-rpm.bin.


3. Log in to the root user and execute the bin file, for example: ~/jdk-6u5-linux-i586-rpm.bin.


4, next configure the environment variables. Execute under root privileges: vi /etc/profile, add the following lines to the end of the file:

export JAVA_HOME=/usr/java/jdk1.6.0_05

export PATH= $JAVA_HOME: $PATH

export CLASSPATH=$JAVA_HOME/lib

and save.


5, log out and complete. At this point, execute: java -version in the terminal to see if it is java version "1.6.0_05". If yes, it means success. If it is not successful, change the above several exports to:


export JAVA_HOME=/usr/java/jdk1.6.0_05

export PATH=/usr/java/jdk1. 6.0_05: $PATH

export CLASSPATH=/usr/java/jdk1.6.0_05/lib

As for why this is changed, it is because of "PATH=$JAVA_HOME:$PATH" $JAVA_HOME" is not parsed by the system. Then why didn't it be solved by the system, I don't know, maybe it's okay to restart it.


Finally, the point to note during the configuration process is: export PATH=$JAVA_HOME:$PATH, but not export PATH=$PATH:$JAVA_HOME. That is to say, we must pay attention to the order of order, because the original $PATH has "/usr/bin", and there is also a java command in "/usr/bin". This java is JDK in /usr/share< Br>

Copyright © Windows knowledge All Rights Reserved