Install the Java EE Environment under Linux (i) Installing JDK

Source: Internet
Author: User

Environment: VirtualBox 4.1 +redhat Linux 6

A. Download jdk

Javase 6 Download:

Http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html

Javase 7 Download:

Http://www.oracle.com/technetwork/java/java-archive-downloads-javase7-521261.html

Download jdk files jdk-6u27-linux-i586.rpm or jdk-6u27-linux-i586.bin;

Note: It is recommended to download JDK6, because the latest use is very little, but also need time to popularize.

B. Production of ISO files containing JDK installation packages, such as Mypackage.iso, to Mount Mypackage.iso on the Linux operating system. Or use VirtualBox enhancements to achieve file sharing between virtual machines and host hosts;

C. Switch to root and copy JDK installation files jdk-7-linux-i586.rpm to redhat any directory. such as/HOMECP???. Rpm/home

D. Go to the installation file directory (CD ...). )

E. Implementation of the RPM-IVH???. RPM OR./??? Bin (Note: here??? Indicates the name of the installation file, such as jdk-6u27-linux-i586. At this point, the system will begin installing the JDK. A new folder named Java can be found in the/usr directory at the end of the installation. This folder is the installed JDK directory.

F. Setting environment variables

1. Enter the/etc folder, find the file profile and open (command: #vi profiles). Or in the terminal directly input vi/etc/profile (if the VI Editor can not edit, switch to the graphical interface with KWrite open for editing)

2. Locate the export pathuser LOGNAME MAIL hostnamehistsize inputrc and modify it to the following form (press I to insert the editor):

Java_home= '/usr/java/jdk1.7.0′

Path= $JAVA _home/bin: $PATH

Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Exportjava_home

Exportpath USER LOGNAME MAIL HOSTNAME histsize inputrc CLASSPATH

Press ESC to exit edit mode, enter at the end of the file: Wq carriage return save and Exit VI

G. Save the file when you have finished setting it up. Log on to the control terminal after restarting the Redhat (or use Source/etc/profile to make the configuration file effective immediately), enter: Java-version, and you can see the correct version number. If you have the words "1.6.0.27" in Java version, your JDK has been installed successfully!

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.