Linux Configuration Java Environment

Source: Internet
Author: User

Beginner's Guide

1. Click on the virtual machine to open the login prompt in the window, enter the username and password

2. View IP Address command: ifconfig to see if there is a Linux address if true continue if False command: Ifup eth0 Open the network card, generally there is IP

3. For ease of operation, can be enabled in the background, find the CentOS file under the Putty/putty.exe double-click to open

4. Enter the IP address click on the Save button open the session window

5. Enter the user name root password ******

6.yum Install wget installation wget "Y" confirmation

7.wget URL (Get the latest JDK installation package address from the www.Oracle.com website.) Download the Linux 64-bit tar.gz compression pack. In the CentOS entry/opt/tools folder, if you do not have this folder, create a manually.

8. Download time is long, after the download is completed, you will find a jdk-***-linux-x64.tar.gz file in the/opt/tools folder.

Unzip this file into the/opt/java folder

  tar zxvf jdk-8u111-linux-x64.tar.gz 做解压缩;

  mv jdk1.8.0_111/  /opt/java 将解压缩后的文件夹移动到opt/java文件夹。

9. Setting the Java environment variables

Edit the. bash_profile file to increase the environment variables for Java:

VI ~/.bash_profile

This command edits the current user's profile file, ~ represents the current User folder.

At the end of the. bash_profile file, add the following:

Export Java_home=/opt/java
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Then save and Exit VI

10. Execute the source ~/.bash_profile command to make the configuration effective.

Execute the command java-version command, print the Java version of the page, stating that the Java installation was successful and that the environment variable configuration took effect.

11. Attached Operation Instruction

1 . Commands for managing files and directories

  CP <source filename> <target filename> Copying files

  CP t.txt document/t The command will copy the file T.txt to the document directory and be named T.

The cat command can be used to merge files or to display the contents of the entire file on the screen.
Cat Snow.txt The command displays the contents of the file Snow.txt, Ctrl+d quits Cat.

MV T.txt document moves the file T.txt to the directory document.

RM t.txt the command to delete the file T.txt

RM-RF fileName Cascade Delete

2 "CD command
The CD command is used to change your directory.
CD/go to the root directory
CD ~ Go to the/home/user user directory
Cd/usr go to the USR directory in the root directory-------------absolute path
CD test goes to-------relative path in the test subdirectory under the current directory

3. Common commands for Getting Started

ll or LS to view the dir in the equivalent of CMD

VI filename Open file, or edit file

Yum install vim installation vim instruction dependent

Yum Install filename installation file

: wq! Exit after saving

: q! Cancel Edit and exit

: To use esc+shift+: (note)

Service Iptables starts boot firewall

Service iptables Stop shutting down the firewall

TAR-ZXVF jdk.tar.gz to extract JDK files (note suffix different commands)

Tail-f logs/catalina.out Viewing the catalina.out calendar output under the Logs folder

Boot tomcat under the bin file of the./startup.sh Tomacat

  

      

Linux Configuration Java Environment

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.