Java - Set Java Runtime Environment (JRE) Project Facets in Eclipse

by
Jeremy Canfield |
Updated: December 06 2022
| Java articles
If you have a project that you want to update to use a certain Java Runtime Environment (JRE), you may need to:
- Set Java Runtime Environment (JRE) in Eclipse
- Set Java Runtime Environment (JRE) Compiler in Eclipse
- Set Java Runtime Environment (JRE) System Library in Eclipse
- Set Java Runtime Environment (JRE) Project Facets in Eclipse (this article)
Here is how you would set the Project Facets Java Runtime Environment (JRE).
- Right click on the project and select Properties
- Select Project Facets
- Set Java to the Java Runtime Environment (JRE) version you want to use > Apply and Close
Or, to be absolutely certain that Eclipse is being run on a certain Java Runtime, you can updated eclipse.ini with the -vm option.
- The
-vm
option and its value (the path to the javaw.exe file) must be on separate lines - The value must be the full absolute or relative path to the javaw.exe file
- The
-vm
option must occur after the other options and before the-vmargs
option - For 32-bit Eclipse a 32-bit version of Java must be used - Or 64-bit Java for 64-bit Eclipse
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\JDK8u332-B09\bin\javaw.exe
-vmargs
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m
--add-modules=ALL-SYSTEM
Did you find this article helpful?
If so, consider buying me a coffee over at