Configure JDK in Fedora Linux 8

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.