Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 875
euphoria83 Avatar asked Jul 27 '09 20:07

euphoria83


People also ask

What is JVM CFG file?

Last Updated: 07/04/2022. [Reading Time Required: 3.5 minutes] Configuration files, such as jvm. cfg, are considered a type of Developer (Configuration) file.

What is the use of JVM in Java?

The role of JVM in Java JVM is specifically responsible for converting bytecode to machine-specific code and is necessary in both JDK and JRE. It is also platform-dependent and performs many functions, including memory management and security.

Where is the JVM config file?

The directory server provides a means of configuring the Java Virtual Machine (JVM) and Java options for each command-line utility and for the directory server itself. The Java configuration is provided in a properties file, located at instance-dir /OUD/config/java.

What is JVM in Java and how it works?

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation.


1 Answers

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.

like image 104
Robert Munteanu Avatar answered Nov 15 '22 13:11

Robert Munteanu