Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
461 views
in Technique[技术] by (71.8m points)

configuration - What is the purpose of jvm.cfg file in relation to Java?

It has some strange keywords. Please explain the general purpose of the file.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Short version:

Controls the JVMs which may be picked with startup flags when invoking java or javac.

Long version:

Let's start with the comments

# List of JVMs that can be used as an option to java, javac, etc.
# Order is important -- first in this list is the default JVM.
# NOTE that this both this file and its format are UNSUPPORTED and
# WILL GO AWAY in a future release.

So we have a list of 'JVM's to pass to java/javac. We need to clarify what a JVM is in the context of this file.

Let's take one simple line:

-green ERROR

and experiment

java -green > /dev/null
Error: green VM not supported

So it seems that the ERROR flag signals an unsupported configuration.

Let's move on to

-classic WARN

and execute

java -classic > /dev/null
Warning: classic VM not supported; client VM will be used

Seems that 'WARN' will send us to the default JVM which seems to be 'client' for us.

Then we can take a look at the first line

-client IF_SERVER_CLASS -server

which seems to signal that the default is server unless the machine is a server-class.

The next one is

-server KNOWN

which means that the server JVM is known.

And finally

-hotspot ALIASED_TO -client

means that hotspot is equivalent to client.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...