Statement: I am a Fedora8 Linux, assuming the current user is abin1. to www.sun.com to download the jdk-6u4-Linux-i586.bin, assuming the download to 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 the command shjdk-6u
Statement: I am a Fedora8 Linux User. Assume that the current user is abin.
1. Download The jdk-6u4-Linux-i586.bin to www.sun.com, assuming it is downloaded to 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:
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
From http://makar.javaeye.com/blog/156721