java - the Java application launcher
java
[ options ] class [ argument ... ]
java
[ options ] -jar
file.jar [ argument ... ]
options
Command-line options.
class
Name of the class to be invoked.
file.jar
Name of the jar file to be invoked.
Used only with -jar
.
argument
Argument passed to the main
function.
The java
tool launches a Java application. It does this by
starting a Java runtime environment, loading a
specified class, and invoking that class's main
method. The
method declaration must look like the following:
public static void main(String args[])
The method must be declared public and static, it must not
return any value, and it must accept a String array as a
parameter. By default, the first non-option argument is the name
of the class to be invoked. A fully-qualified class name should be used.
If the -jar
option is specified, the first non-option argument
is the name of a JAR
archive containing class and resource files
for the application, with the startup class indicated by the
Main-Class
manifest header.
The Java runtime searches for the startup class, and other classes
used, in three sets of locations: the bootstrap class path, the
installed extensions, and the user class path.
Non-option arguments after the class name or JAR file name are passed
to the main
function.
The launcher has a set of standard options
that
are supported on the current runtime environment and will be supported in
future releases.
In addition, the current implementations of the virtual machines support
a set of non-standard options
options that
are subject to change in future releases.
-client
Select the Java HotSpot Client VM. This is the default.
-server
Select the Java HotSpot Server VM.
-classpath
classpath
-cp
classpath
Specify a list of directories, JAR archives, and ZIP
archives to search for class files. Class path entries are
separated by colons (:
). Specifying
-classpath
or -cp
overrides any setting of the
CLASSPATH
environment variable.
If -classpath
and -cp
are not used and
CLASSPATH
is not set, the user class path consists of
the current directory (.
).
For more information on class paths, see
Setting the Class Path
.
-D
property
=
value
Set a system property value.
-jar
Execute a program encapsulated in a JAR file. The first
argument is the name of a JAR file instead of a startup
class name. In order for this option to work, the manifest of
the JAR file must contain a line of the form
Main-Class: classname
.
Here, classname
identifies the class having the
public static void main(String[] args)
method that serves as your application's starting point. See
the Jar tool reference page
and
the Jar trail of the
Java
Tutorial
for information about working with Jar files and
Jar-file manifests.
When you use this option, the
JAR file is the source of all user classes, and other user class
path settings are ignored.
On Solaris 8
, JAR files that can be run with
the "java -jar" option can have their execute permissions
set so they can be run without using "java -jar".
-verbose
-verbose:class
Display information about each class loaded.
-verbose:gc
Report on each garbage collection event.
-verbose:jni
Report information about use of native methods and other
Java Native Interface activity.
-version
Display version information and exit.
-showversion
Display version information and continue.
-?
-help
Display usage information and exit.
-X
Display information about non-standard options and exit.
-Xint
Operate in interpreted-only mode. Compilation to native code
is disabled, and all bytecodes are executed by the interpreter.
The performance benefits offered by the Java HotSpot VMs' adaptive
compiler will not be present in this mode.
-Xdebug
Start with the debugger enabled. Refer to
jdb description
for more
details and an example.
-Xbootclasspath:
bootclasspath
Specify a colon-separated list of directories, JAR
archives, and ZIP archives to search for boot class files.
These are used in place of the boot class files included in the
Java 2 SDK. Note: Applications that use this option for the
purpose of overriding a class in rt.jar should not be deployed
as doing so would contravene the Java 2 Runtime Environment
binary code license.
-Xbootclasspath/a:
path
Specify a colon-separated path of directires, JAR
archives, and ZIP archives to append to the default bootstrap
class path.
-Xbootclasspath/p:
path
Specify a colon-separated path of directires, JAR
archives, and ZIP archives to prepend in front of the default
bootstrap class path. Note: Applications that use this option
for the purpose of overriding a class in rt.jar should not be
deployed as doing so would contravene the Java 2 Runtime Environment
binary code license.
-Xfuture
Perform strict class-file format checks. For purposes of backwards
compatibility, the default format checks performed by the
Java 2 SDK's virtual machine are no stricter than
the checks performed by 1.1.x versions of the JDK software. The
-Xfuture
flag turns on stricter class-file format checks
that enforce closer conformance to the class-file format
specification. Developers are encouraged to use this flag
when developing new code because the stricter checks will
become the default in future releases of the Java application
launcher.
-Xnoclassgc
Disable class garbage collection.
-Xincgc
Enable the incremental garbage collector. The incremental
garbage collector, which is off by default, will eliminate
occasional garbage-collection pauses during program execution.
However, it can lead to a roughly 10% decrease in overall
GC performance.
-Xmsn
Specify the initial size, in bytes, of the memory allocation pool.
This value must be
a multiple of 1024 greater than 1MB. Append the
letter k
or K
to indicate kilobytes, or m
or M
to indicate megabytes. The default value is 2MB.
Examples:
-Xms6291456
-Xms6144k
-Xms6m
-Xmxn
Specify the maximum size, in bytes, of the memory allocation pool.
This value must a multiple of 1024 greater than 2MB. Append the letter
k
or K
to indicate kilobytes, or m
or
M
to indicate megabytes. The default value is 64MB.
The upper limit for this value will be approximately 4000m
on Solaris 7 and Solaris 8 SPARC platforms and 2000m on Solaris 2.6
and x86 platforms, minus overhead amounts. Examples:
-Xmx83886080
-Xmx81920k
-Xmx80m
-Xssn
Set thread stack size. Each Java thread has two stacks: one for
Java code and one for C code. This
option sets the maximum stack size that
can be used by C code in a thread to n
.
Every thread that is spawned during the
execution of the program passed to java
has n
as its C stack size. The default
units for n
are bytes and n
must
be > 1000 bytes.
To modify the meaning of n
, append
either the letter k
for kilobytes or the
letter m
for megabytes. The default
stack size is 512 kilobytes (-Xss512k
).
-Xprof
Profiles the running program, and sends profiling data to
standard output. This option is provided as a utility that
is useful in program development and is not intended to be
be used in production systems.
-Xrunhprof
[:help
][:<suboption>=<value>,...
]
Enables cpu, heap, or monitor profiling. This option is typically
followed by a list of comma-separated "<suboption>=<value>"
pairs.
Run the command java -Xrunhprof:help
to obtain a
list of suboptions and their default values.
-Xrs
Reduces use of operating-system signals by the Java virtual
machine (JVM). This option is available beginning with J2SE 1.3.1.
In J2SE 1.3.0, the Shutdown Hooks facility was added to allow orderly
shutdown of a Java application. The intent was to allow user cleanup
code (such as closing database connections) to run at shutdown, even
if the JVM terminates abruptly.
Sun's JVM catches signals to implement shutdown
hooks for abnormal JVM termination. The JVM uses SIGHUP, SIGINT, and
SIGTERM to initiate the running of shutdown hooks.
The JVM uses a similar mechanism to implement the pre-1.2 feature of
dumping thread stacks for debugging purposes. Sun's JVM uses SIGQUIT
to perform thread dumps.
Applications embedding the JVM frequently need to
trap signals like SIGINT or SIGTERM, which can lead to interference
with the JVM's own signal handlers. To address this issue, the
-Xrs
command-line option has been added
beginning in J2SE 1.3.1. When -Xrs
is used on Sun's JVM,
the signal masks for SIGINT, SIGTERM, SIGHUP, and SIGQUIT are not
changed by the JVM, and signal handlers for these signals are not
installed.
There are two consequences of specifying -Xrs
:
- SIGQUIT thread dumps are not available.
- User code is responsible for causing shutdown hooks to run, for
example by calling System.exit() when the JVM is to be terminated.
WARNING:
Flags -Xdebug
and -Xint
are mutually exclusive. No more than one of
those options should be used on a java
command line.
分享到:
相关推荐
基于智能温度监测系统设计.doc
包括userCF,itemCF,MF,LR,POLY2,FM,FFM,GBDT+LR,阿里LS-PLM 基于深度学习推荐系统(王喆)
2023-04-06-项目笔记-第三百五十五阶段-课前小分享_小分享1.坚持提交gitee 小分享2.作业中提交代码 小分享3.写代码注意代码风格 4.3.1变量的使用 4.4变量的作用域与生命周期 4.4.1局部变量的作用域 4.4.2全局变量的作用域 4.4.2.1全局变量的作用域_1 4.4.2.353局变量的作用域_353- 2024-12-22
和美乡村城乡融合发展数字化解决方案.docx
基于Python的深度学习图像识别系统是一个利用卷积神经网络(CNN)对图像进行分类的先进项目。该项目使用Python的深度学习库,如TensorFlow,构建和训练一个模型,能够自动识别和分类图像中的对象。系统特别适合于图像处理领域的研究和实践,如计算机视觉、自动驾驶、医疗影像分析等。 项目的核心功能包括数据预处理、模型构建、训练、评估和预测。用户可以上传自己的图像或使用预定义的数据集进行训练。系统提供了一个直观的界面,允许用户监控训练进度,并可视化模型的性能。此外,系统还包括了一个模型优化模块,通过调整超参数和网络结构来提高识别准确率。 技术层面上,该项目使用了Python编程语言,并集成了多个流行的机器学习库,如NumPy、Pandas、Matplotlib等,用于数据处理和可视化。模型训练过程中,系统会保存训练好的权重,以便后续进行模型评估和预测。用户可以通过简单的API调用,将新的图像输入到训练好的模型中,获取预测结果。
拳皇97.exe拳皇972.exe拳皇973.exe
基于python和协同过滤算法的电影推荐系统 基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法的电影推荐系统基于python和协同过滤算法
DEV-CPP-RED-PANDA
Python语言求解旅行商问题,算法包括禁忌搜索、蚁群算法、模拟退火算法等。
pdfjs 用于在浏览器中查看/预览/打印pdf。 pdfjs 2.5.207 支持firefox/chrome/edge/ie11以上版本。 如果需要支持旧版本浏览器,可以使用这个,是未修改过的原版,支持打印和下载按钮。亲测有效。 pdf 4.9.155分两个包: pdfjs-4.9.155-dist.zip pdfjs-4.9.155-legacy-dist.zip
建设项目现场高温人员中暑事故应急预案
数据结构上机实验大作业-线性表选题.zip
【资源说明】 基于高德地图的校园导航全部资料+详细文档+高分项目.zip 【备注】 1、该项目是个人高分项目源码,已获导师指导认可通过,答辩评审分达到95分 2、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 3、本项目适合计算机相关专业(人工智能、通信工程、自动化、电子信息、物联网等)的在校学生、老师或者企业员工下载使用,也可作为毕业设计、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 4、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
【静态站群程序视频演示,只有视频,不含程序,下载须知】【静态站群程序视频演示,只有视频,不含程序,下载须知】全自动批量建站快速养权重站系统【纯静态html站群版】:(GPT4.0自动根据关键词写文章+自动发布+自定义友链+自动文章内链+20%页面加提权词)
9.30 SWKJ 男头7张+女头2张.zip
项目已获导师指导并通过的高分毕业设计项目,可作为课程设计和期末大作业,下载即用无需修改,项目完整确保可以运行。 包含:项目源码、数据库脚本、软件工具等,该项目可以作为毕设、课程设计使用,前后端代码都在里面。 该系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值。 项目都经过严格调试,确保可以运行!可以放心下载 技术组成 语言:java 开发环境:idea、vscode 数据库:MySql5.7以上 部署环境:maven 数据库工具:navicat
一个通过单片机在各种屏幕上显示中文的解决方案.7z
图像
一、用户管理功能 用户注册与登录 学生注册:学生可以通过手机号、邮箱、社交账号等方式注册,填写个人信息(如姓名、年龄、学校等)。 家长/监护人账户:支持家长/监护人注册并管理学生账户,查看学习进度和成绩。 教师账户:教师可以注册并设置个人资料,上传资质认证文件。 管理员账户:管理员负责整个系统的管理,包括用户管理、课程管理、平台设置等。 用户权限管理 角色权限:系统根据用户类型(学生、家长、教师、管理员)分配不同权限,确保信息安全。 家长监督:家长可以查看子女的学习进度、成绩和教师反馈,参与学习监督。 个人资料管理 用户可以在个人中心更新基本信息,设置个人头像、联系方式、密码等。 支持学籍信息的维护,例如学生的年级、班级、课程历史等。 二、课程管理功能 课程设置 课程创建与编辑:教师或管理员可以创建和编辑课程内容,上传课件、视频、文档等教学材料。 课程分类:根据学科、年级、难度等维度进行课程分类,方便学生浏览和选择。 课程排课:管理员可以设置课程的时间表、教学内容和授课教师,并调整上课时间和频率。 课程安排与通知 课程预约:学生可以在线选择并预约感兴趣的课程,系统根据学生的时
内容概要:本文档介绍了英特尔2021年至2024年的网络连接性产品和智能处理单元(IPU)的战略和技术路线图。涵盖了从10GbE到200GbE的不同系列以太网适配器的特性、性能和发布时间。详细列出了各个产品的关键功能,如PCIe接口、安全特性、RDMA支持等。同时,介绍了IPU的发展计划,包括200G、400G和800G的不同代次产品的性能提升和新的功能特点。 适合人群:从事网络工程、数据中心管理、IT架构设计的专业技术人员。 使用场景及目标:本文档主要用于了解英特尔未来几年在以太网适配器和IPU领域的技术和产品规划,帮助企业在采购和部署网络设备时做出决策。同时,为研究人员提供最新技术发展趋势的参考。 其他说明:文档内容涉及的技术细节和时间表可能会有变动,请以英特尔官方发布的最新信息为准。