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

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

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!

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

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 }}