In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how common JAVA virtual machine command line parameters are used. The content of the article is of high quality. Therefore, Xiaobian shares it with you as a reference. I hope that after reading this article, you will have a certain understanding of relevant knowledge.
Java virtual machine several command line parameters
I. Run class files
Execute a class file with main method, command behavior:
java
Note: CLASS file names do not have file suffix.class
For example:
javaTest
If the class file executed is packaged, that is, the class file uses:
package
That should be executed under the base path of the package, command behavior:
java.CLASS filename
For example:
PackageTest.java, its package name is com.ee2ee.test, the corresponding statement is:
packagecom.ee2ee.test;
PackageTest.java and the compiled class file PackageTest.class are stored in the following directory:
classes
|__com
|__ee2ee
|__test
|__PackageTest.java
|__PackageTest.class
To run PackageTest.class, execute under the classes directory:
javacom.ee2ee.test.PackageTest
Let's take a look at the usage of the second command-line parameter of the Java Virtual Machine.
Second, run the jar file class
The principle is the same as running a class file, just add the parameter-cp.
For example, execute the class com.ee2ee.test.PackageTest in test.jar with the following command line:
java-cptest.jarcom.ee2ee.test.PackageTest
Third, display jdk version information
When there are multiple versions of jdk on a machine, you need to know which version of jdk is currently in use. Use the parameter-version to know its version. Command behavior:
java-version
IV. Increase the *** memory that virtual machines can use
The amount of *** memory available to Java virtual machines is limited, and the default is usually 64MB or 128MB.
If an application loads data into memory in order to improve performance and occupies a large amount of memory, such as exceeding the default *** value of 128MB, you need to increase the *** memory available to the Java virtual machine, otherwise an Out of Memory exception will occur. When starting Java, you need to use the following two parameters:
- Memory size used when Xmsjava VM is initialized
- *** memory available for Xmxjava virtual machine
The size set in the above two parameters can have units, for example: 256m means 256MB
Examples:
java-Xms128m-Xmx256m...
Indicates that the Java virtual machine uses 128MB of memory for initialization and 256MB of available *** memory.
For tomcat, you can modify its script catalina.sh (unix platform) or catalina.bat (windows platform), and set the variable JAVA_OPTS, for example:
JAVA_OPTS='-Xms128m-Xmx256m' about common JAVA virtual machine command line parameter usage is how to share here, I hope the above content can have some help for everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.