Configure JDK in Linux (Fedora8 environment)

Source: Internet
Author: User
Tags echo command
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

Related Article

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.