Reputation: 99408
From Java In a Nutshell
jps
provides a list of all active JVM processes on the local machine (or a remote machine, if a suitable instance ofjstatd
is running on the remote side).
What does "JVM processes" here mean,
processes of the underlying OS which run JVM exactly, or
processes that are supported by Java via Process
, ProcessBuilder
and Runtime.exec()
...
Thanks.
Upvotes: 3
Views: 2978
Reputation: 29307
JVM stands for Java Virtual Machine.
In plain English, a virtual machine (VM) is any piece of software that simulates a real machine. There are two kinds of VMs:
A system virtual machine provides the functionality of a real computer. A process virtual machines allows to execute programs in one specific programming language. The advantage of a process VM (sometimes also called managed runtime environment) is that it provides the same environment across different platforms.
JVM is the process virtual machine for Java.
Since of the main design goals of Java is portability, the Java language code gets compiled to an intermediate representation called Java bytecode that can be executed on a JVM.
So, basically every time you run Java code you start an own JVM process.
Image source: Introduction to Computer Science using Java
There are exceptions to that, namely special-purpose processors that can interpret Java bytecode: with such processors Java is executed directly on the hardware without using a virtual machine. An example are ARM processors endowed with the Jazelle DBX direct bytecode execution.
Upvotes: 1
Reputation: 131324
A running Java Virtual Machine (JVM) instance is materialized by a native process launched by an OS while a Process
class instance is a native process launched by a running JVM.
As each Java Virtual Machine is associated to a specific native process, instead of saying a process that runs a JVM, we could so shortcut it by a JVM process.
Upvotes: 5