Install and configure JDK in RedHat Linux 9

Source: Internet
Author: User

Generally, it is installed as the root user.
First download a JDK from the sun website. For example: j2sdk1_4_2_05-linux-i586.bin, put in the/usr/local directory,
[Root @ server/] # chmod A + x j2sdk1_4_2_05-linux.bin (add execution permission)
[Root @ server/] #./j2sdk1_4_2_05-linux.bin (execute j2sdk1_4_2_05-linux.bin)

The j2sdk1_4_2_05-linux.rpm is generated in this directory after execution
Install with RPM:
[Root @ server/] # rpm-IV j2sdk1_4_2_05-linux.rpm

After installation, set the environment variables:
Set the followingCodeAdd to/etc/profile:

Java_home =/usr/Java/j2sdk1.4.2 _ 05/
Classpath =/usr/Java/j2sdk1.4.2 _ 05/JRE/lib/RT. jar :.
Path = $ path:/usr/Java/j2sdk1.4.2 _ 05/bin
Export java_home classpath path

Test
[Root @ server/] # source/etc/profile
[Root @ server/] # Java-version

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.