Get JVM environment variables and operating system environment variables

Get environment variables

The environment variable here refers to the environment variable associated with the JVM, such as the environment variable set in the following way.

 #Set on the command line at runtime: 
java -Ddebug=true YourClass 

 #Set in the program
System.setProperty("debug", "true");  

   #Get in the program
String debug = System.getProperty("debug"); 

There are also some predefined environment variables, commonly used as follows:
java.version
java.home
os.name
os.version
user.name
user.home
user.dir

Get the environment variables of the operating system

System.getenv()
System.getenv(aString)

Intelligent Recommendation

Several methods Linux operating system environment variables

A use environment variable output pointer environ code show as below: II. Using Functions First to note is that, through this function and you can not add or modify environment variables shell process...

Configuration of linux operating system environment variables

1. Enter the configuration file 2. Variable Add Format 3. Make the configuration file effective immediately 4. The following is an example of java and maven environment variable settings Come here, le...

Python operating environment variables

1, use os to read environment variables 2, traversal print all environment variables The entire system environment variable can be obtained by accessing os.environ. 3, add new environment variables...

How to use System to get system environment variables

The System system class contains some useful class variables and class methods, which can be called through the System class. But it cannot be instantiated. The System class represents the running pla...

More Recommendation

Java get environment variables and get and set system variables

1. Java obtains environment variables The way Java gets environment variables is very simple: System.getEnv() Get all environment variables System.getEnv(key) Get the value of an environment variable ...

Windows system, set up environment variables and configuration of the operating environment python3

1) downloading the installation package python Go to URLhttps://www.python.org/downloads/Check which version specific installation, look at your specific needs Bloggers love has always been the highes...

shell system variables and environment variables

System variables Shell language system variables are mainly used for parameter judgment and command return value judgment, including script and function parameters and script and function return value...

Windows system variables and environment variables

Difference of user variables and system variables Reprinted from: https://www.cnblogs.com/xinxianquan/p/10663756.html 1. When the software is configured, it is a copy, and there is no specific thinkin...

C # How to get the system environment variables

C # in the acquisition system environment variables need to useEnvironment Class. among themIt provides information about the current environment and platform as well as their method of operation. Tha...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top