Basic Environment Variable knowledge

Source: Internet
Author: User
Article Title: Basic knowledge about environment variables. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. View All environment variables: env

2. view a variable value: echo $ variable name

3. Set a new variable: export variable name = variable value

4. Set a variable value if it already exists.

Export classpath = $ classpath:/path/to/program

Note: different variables in unix are separated by colons (:).

5. Use unset to clear Environment Variables

Set can set the value of an environment variable. Clear the unset.

If not specified, the variable is null.

Eg: $ export TEST = "test" // Add a variable

$ Env | grep TEST // This command has output to prove that the variable TEST already exists.

The output result is as follows: TEST = test

$ Unset TEST // Delete

$ Env | grep TEST // This command is not output, proving that the variable TEST does not exist

6. Set the java class path

There are three methods:

1> permanent, implemented by setting the classpath environment variable at the system level.

Reload the profile environment # source/etc/profile

2> temporarily, you can set the classpath environment variable in the Command window or shell.

3> at runtime, the class path must be specified each time the java application and JVM are started.

This article from the CSDN blog, reproduced please indicate the source: http://blog.csdn.net/blueyaya/archive/2005/09/29/491800.aspx

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.