Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using Eclipse With Its Local Version of the JVM

DZone's Guide to

Using Eclipse With Its Local Version of the JVM

Worried about whether a host machine has a JVM installed? Fear not! Just package and include it with your Eclipse IDE to make it self-contained.

· Java Zone ·
Free Resource

How do you break a Monolith into Microservices at Scale? This ebook shows strategies and techniques for building scalable and resilient microservices.

Eclipse is probably the most used and de facto standard IDE for any development for ARM Cortex or any other devices. It is very easy these days to construct an unlimited and unrestricted IDE (see Breathing with Oxygen: DIY ARM Cortex-M C/C++ IDE and Toolchain with Eclipse Oxygen). Up to the point that I can pack it into a .zip file and pass it around, e.g. in a classroom environment, so no installer at all is needed with the exception of the debug probe USB drivers. As Eclipse is using a Java Virtual Machine (VM), it is a good idea to bundle the VM with the IDE, and this article is about how to do this.

Eclipse Oxygen running with its own Java Virtual Machine

Eclipse Oxygen running with its own Java Virtual Machine

First, I need to find the Java VM. Usually, it is already installed on the host machine (otherwise install it from https://java.com). Usually, on Windows, it is in c:\Program Files\Java.

Or I can use the Java control panel and the ‘View’ button to see where it is running:

Path to Java

Path to Java

Copy that Java folder into the Eclipse folder:

Local Java VM inside Eclipse

Local Java VM inside Eclipse

Open the Eclipse.ini and add the following two lines right after –launcher.appendVmargs:

-vm
Java/jre1.8.0_144/bin/javaw.exe


Using local VM in Eclipse.ini

Using local VM in Eclipse.ini

Then launch Eclipse. I can check which Java VM is used using the Help > About menu item. Clicking in the dialog on the ‘Installation Details’ gives me the Java VM used:

Configuration Details

Configuration Details

That’s it! I’m running Eclipse with a local Java VM and do not depend on one installed on the host.

That, of course, potentially duplicates the Java VM on a machine. But on the other hand, it makes the Eclipse IDE very self-contained, which is a good thing in many ways.

Happy Java'ing!

How do you break a Monolith into Microservices at Scale? This ebook shows strategies and techniques for building scalable and resilient microservices.

Topics:
java ,eclipse ,jvm ,arm cortex-m ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}