Install jdk1.5 in FC5andfc4 and set Environment Variables

Source: Internet
Author: User
Install jdk1.5 in FC5andfc4 and set environment variables-Linux general technology-Linux programming and kernel information. For details, refer to the following. 1. Download jdk.

From here you can find the latest JDK: http://java.sun.com/

Based on your own machine to download the corresponding version, I downloaded is the jdk-1_5_0_02-linux-i586.bin, this is J2SE Development Kit 1.5 update 5 for Linux sh self-decompressed execution script. The package has been installed.

1. Release the Software Package

View All files in the current directory

[Lee @ lee-Linux-OS linuxsoft] $ ls

Jdk-1_5_0_02-linux-i586.bin

Execute the sh self-extracting script

[Lee @ lee-Linux-OS linuxsoft] $./jdk-1_5_0_02-linux-i586.bin
Do you agree to the above license terms? [Yes or no] yes

View All files in the current directory again

[Lee @ lee-Linux-OS linuxsoft] $ ls
Jdk1.5.0 _ 04 jdk-1_5_0_02-linux-i586.bin

In fact, the sh script will release a folder named jdk1.5.0 _ 05 to the current directory.

2. Configure the Java compiling and running environment

1. Place Java

Move or copy the jdk1.5.0 _ 02 folder to the/usr/local directory.
[Lee @ lee-Linux-OS linuxsoft] $ mv jdk1.5.0 _ 02/usr/local/

2. Create shortcuts to replace GCJ

Create shortcuts (static links) for java and javac to replace gcj.

# Cd/usr/bin
# Ln-s-f/usr/local/jdk1.5.0 _ 02/jre/bin/java
# Ln-s-f/usr/local/jdk1.5.0 _ 02/bin/javac

The-f parameter of the ln command is used to forcibly overwrite the existing/usr/local/java static link file. Because the bin folder in the jdk directory can replace/jdk1.5.0 _ 02/jre/bin, you can also directly use the/jdk1.5.0 _ 02/bin path.

Note: GCJ is not permanently deleted from your computer. You can still find it using the whereis gcj command and use it as needed.

1. Configure environment variables (personalized configuration of independent end users ).

Edit the. bashrc of the current user, that is:
QUOTE:
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.