Configure JDK in Fedora Linux 8
Download the jdk-6u4-linux-i586.bin to sun.com, assuming that the download is under the current user directory;
2. Create the software Directory under/home/abin and copy the jdk-6u4-linux-i586.bin to the software Directory;
3. find the terminal, go to/home/abin/software, Execute Command sh jdk-6u4-linux-i586.bin, the screen will show some protocol files, one way press enter, at last will recognize you confirm installation, enter yes, press enter. Wait a moment ......, A jdk1.6.0 _ 04 folder is generated under/home/abin/software. This is the jdk installation directory.
Okay. Set the jdk environment variable as follows:
4. If it is only for the current user, go to the current user directory (/home/abin), edit the. bashrc file, and add the environment variable at the end, as shown below:
QUOTE: JAVA_HOME=/home/abin/software/jdk1.6.0_04 CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME CLASSPATH PATH |
5. to be used by all users, log on as the root user, enter the/etc directory, and add the above environment variables at the end of the profile file.
Note: When setting environment variables, pay attention to the following points:
A) The first is the format of environment variables. previously set in windows to separate the paths with semicolons, and use colons in linux;
B) Second, check whether there are any variables to be set in the system. If yes, add ": $ variable name" to the variable with the same name. For example, if the PATH variable exists in the system, you must write PATH = $ JAVA_HOME/bin: $ PATH when setting the PATH variable. Otherwise, the last set content will overwrite the previous content.
To check whether a variable with the same name exists in the system, run the echo command in the following format: echo $ PATH
6. After the configuration is complete, enter java-version on the terminal to display the JDK version information, indicating that the installation is successful.