The Linux command I used--install JDK

Source: Internet
Author: User

First of all, my test environment is a CentOS Linux virtual machine, and if you want to install the JDK, first you have to have a JDK. The software used is WINSCP, which transfers the JDK from Windows to Linux.

1. JDK transfer from Windows to Linux

Use WINSCP to transfer the JDK from Windows to the root user of Linux under the download file.

You can also see the permissions of the transferred files in WinSCP, which makes it easier to operate.

2. Select the installation directory for the JDK

Here you choose to install in the Linux/usr/local folder, first delete all the useless files inside

#rm-RF *

Then copy the installation files to this directory.

#cp ~/downloads/*  .    Copy all files under the Root/downloads folder to the current path, the current path is/usr/local

After all of these, all the installation files have reached the specified installation directory and the installation begins below.

3. Modify permissions to start the installation

See the JDK file suffix is. bin, so it can be run directly. Modify its permissions

744 xxx    // Modify file permissions so that the file owner has full permissions, the file group and other groups have read-only permissions

Then execute the file, that is, unzip. When you are finished, you will get a file directory jdk1.6.0_24. Because this name is a bit long, rename this file directory

#mv Jdk1. 6. 0_24 JDK

4. JDK Settings Environment variables

The configuration file for the CentOS environment variable is/etc/profile

#vi/etc/profile

In this configuration file, add:

Export java_home=/usr/local/jdkexport PATH=.: $JAVA _home/bin: $PATH

Then save the exit.

Make the configuration file immediately effective

#source/etc/profile

Verify that:

The Linux command I used--install JDK

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.