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 class room 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.
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:
Copy that Java folder into the Eclipse folder:
Open the Eclipse.ini and add the following two lines right after –launcher.appendVmargs:
-vm Java/jre1.8.0_144/bin/javaw.exe
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:
That’s it! I’m running now Eclipse with a local Java VM and do not depend on one installed otherwise on the host :-).
That of course potentially duplicates the Java VM on a machine. But on the other end it makes the Eclipse IDE very self-contained which is a good thing in many ways.
Happy Javing 🙂
Hi Erich
I agree, it’s very convenient to have everything in one zip. But on the other hand there’s also a potential security risk. Eclipse may/will open connections to remote internet servers. There may be (well there certainly is) a bug in the wm, which may be used to do nasty things on you computer. Now it’s your responsibility to maintain the bundled java, otherwise you can rely on your IT department (I’m not saying they to a better job…)
LikeLike
Good point. But I don’t see how this would be differnt from a shared VM on that machine. Well, except that the VM I provide would be outdated.
LikeLike
With a standard install of the Oracle JRE on Windows, or the default JRE provided with a Linux distro, the user will be offered updates and the opportunity to remove older versions of the JRE. Oracle strongly recommends that older versions are uninstalled (even though the older versions will no longer be the default JRE): https://www.java.com/en/download/faq/remove_olderversions.xml
If a provider bundles a JRE with an Eclipse-based product, the provider should assume responsibility for keeping that JRE up to date.
LikeLike
This is also handy (and required) if you have different 32- vs. 64-bit versions of things installed.
LikeLike
Yes, we basically came to the conclusion that we should bundle the Java VM with Eclipse because some students had 64bit Windows, but for some reasons only 32bit Jave VM installed on their system. With the VM bundled we can avoid this kind of issues.
LikeLike
Oracle strongly recommends that older versions are uninstalled (even though the older versions will no longer be the default JRE): Now it’s your responsibility to maintain the bundled java, otherwise you can rely on your IT department (I’m not saying they to a better job…)
LikeLike
Oracle strongly recommends that older versions are unestablished (even though the older versions will no longer be the nonpayment JRE): <a href="https://www. With a standard establish of the Oracle JRE on Windows, or the nonpayment JRE provided with a Linux distro, the user will be offered updates and the opportunity to bump off older versions of the JRE.
LikeLike
Hi,
yes, that’s understood. It is pitty that Oracle does not allow redistribution of the JRE in an official way? Not having bundled the JRE with applications they depend on it is a real pain.
LikeLike
FWIW Eclipse searches for a sub-folder named ‘jre’ inside its folder, and use that if no -vm is configured explicitly in the .ini.
(And for the last couple of releases Eclipse’s been bundling a JRE that is installed in the P2 repo)
LikeLike
That’s good to know, thanks for sharing! I have not realized that it works that way too, definitely good to know.
LikeLike