Java startup parameter One

Source: Internet
Author: User

Java startup parameters are divided into three categories;
The first is the standard parameter (-), all JVM implementations must implement the functions of these parameters, and backward compatibility;
The second is the non-standard parameter (-X), the default JVM implements the functions of these parameters, but does not guarantee that all JVM implementations are satisfied, and does not guarantee backward compatibility;
The third is the non-stable parameter (-XX), such parameters of each JVM implementation will be different, in the future may be canceled at any time, need to use cautiously; This article mainly describes the standard parameters section, the remaining two parts will be introduced in succession;

The standard parameters are as follows:
-client
The provisioning JVM uses the client mode, which is characterized by faster startup, but inefficient runtime performance and memory management, typically used for client application or PC application development and debugging.
-server
Set the JVM to make the server mode, characterized by a slow start-up speed, but run-time performance and memory management is very efficient, suitable for production environments. This mode is enabled by default in a JDK environment with 64-bit capability, and the-client parameter is ignored.
-agentlib:libname[=options]
Used to load the local Lib package, where Libname is the local agent library file name, the default search path is the path in the environment variable path, options is passed to the local library when the parameter is started, and multiple parameters are separated by commas.
On the Windows platform, the JVM searches for files with local libraries named Libname.dll, and on Linux the JVM searches for files with local libraries named Libname.so, and the search path environment variables differ on different systems, such as the default on Solaries
Search for Ld_library_path. For example:-agentlib:hprof is used to obtain the operation of the JVM, including CPU, memory, thread and other operational data, and can be exported to the specified file;
The search path in Windows is Jre_home/bin/hprof.dll.

-agentpath:pathname[=options]
Load local libraries by full path, no longer search paths in path; Other functions are the same as agentlib; more information to be continued,
In the subsequent JVMTI section will be detailed.
-classpath Classpath
-CP Classpath
Tell the JVM to search directory names, jar document names, zip document names, separated by semicolons, and-classpath after using the JVM
The class search path in Classpath is no longer used, and if both-classpath and classpath are not set, the JVM uses
Current path (.) As a class search path. The way and order in which the JVM searches for classes is: Bootstrap,extension,user.
The path in bootstrap is a jar or zip file that comes with the JVM, and the JVM searches for these package files first, using
System.getproperty ("Sun.boot.class.path") to obtain the search path. Extension is located
The jar file in the Jre_home/lib/ext directory, the JVM searches for the jar file under the directory after searching for bootstrap,
Use System.getproperty ("Java.ext.dirs") to get the search path.
The user search order is the current path., CLASSPATH,-CLASSPATH,JVM the last search for these directories,
Use System.getproperty ("Java.class.path") to get the search path.

-dproperty=value
Set the system attribute name/value pair, the application that runs on top of this JVM is available System.getproperty ("property")
Gets the value. If there are spaces in value, you need to enclose the value in double quotation marks, such as-dname= "space string".
This parameter is typically used to set system-level global variable values, such as a configuration file path, so that the property is anywhere in the program
can be accessed.

-enableassertions[:

.
-disableassertions[:

Java startup parameter One

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.