What is the difference between a Java virtual machine and a VMWare VM?

5,358

Solution 1

The term virtual machine is a colloquialism in that it simply refers to the idea of a machine (not the actual thing itself). Due to this it can refer to almost any piece of software (hence the virtual) that "acts" like a machine. A video game emulator is a virtual machine (and actually quite like how the JavaVM works).

The biggest difference between types of virtual machines is in what they virtualize and how they do it (i.e. how they abstract the idea of a machine).

VMWare (VirtualBox/etc.) attempt to present the hardware on the host machine to the guest machine so the guest machine can use the hardware directly (like being able to use a USB device on the guest) and in this context not much is actually virtualized (in the classic sense of the word) since the guest uses the hardware itself. To this, VMWare/etc. are more like hardware proxies more so than a "virtual machine". Software built for one platform/architecture will still only run for that platform/architecture regardless of virtual machine guest/host.

As for Java, it's more proper to say "the" Java Virtual Machine, more than "a" Java virtual machine; the JVM attempts to abstract the hardware and machine itself so the developer doesn't have to concern themselves with things like architecture type or platform. Software built with Java should run on any platform that has the proper JVM version installed, regardless of physical machine type.

The difference between these two concepts of a virtual machine is in abstraction and running code natively (i.e. direct on the hardware). The JVM attempts to abstract as much of the platform/architecture/machine as possible to make the code as agnostic as possible to be able to run on as many devices as possible (that support Java), where as a VMWare/VirtualBox container abstracts the physicality of the machine as much as possible so you can reduce the physical hardware needed to run a platform, though you still have the same soft limitations (e.g. I can't write ARM assembly and expect it to 'just run' on an x86 processor in VMWare/VirtualBox).

There's quite a bit more detail that could be explained in the 'exact' differences between these 2 types of virtual machines (more so than say comparing the JVM to .NET or the WINE emulator), but that gets into lower level systems design; at a high level though, this should help explain the key differences between the JVM and a VMWare VM.

I hope that helps to add some clarity.

Solution 2

The main difference is the underlying machine. With Java, it is a well specified ad hoc pure software machine with its own machine language (bytecode) while with VMWare (or VirtualBox, etc.), the underlying machine presented is close to a physical PC using the same machine language as the real hardware (x86).

Share:
5,358

Related videos on Youtube

WinMacLinUser
Author by

WinMacLinUser

Updated on September 18, 2022

Comments

  • WinMacLinUser
    WinMacLinUser over 1 year

    I know that they are both called 'virtual machines', but what is the exact difference?

  • TOOGAM
    TOOGAM about 8 years
    "it's more proper"... I disagree; if there are two physical systems using Java, I'd say there is a virtual machine running on each, so there are two virtual machines. (This statement is largely based on opinion.)
  • txtechhelp
    txtechhelp about 8 years
    @TOOGAM, in the context of the question/answer, it's proper to use "the" vs. "a" since the OP is asking about the differences between "a" VMWare VM (a thing) and "the" Java Virtual Machine (an idea). In actually referencing the instances of the running JVM then yes, "a" would be proper, as in those 2 machines have "a" JVM running, etc. Not trying to be pedantic, just clarifying why I was specifying "the" vs. "a" :)