In order to test the validity and integrity of the JustJ JRE p2 repositories,
a Sample.product
is defined to use them.
The build-sample-product
pipeline builds them and publishes them to
https://download.eclipse.org/justj/sample-products/*
.
All three versions have been verified to work on each of their respective operating systems.
To build a feature-based product with an embedded JRE, just include the following in the <features>
section of the *.product
:
<feature id="org.eclipse.justj.openjdk.hotspot.jre.full" installMode="root"/>
To build a plugin-based product with an embedded JRE, just include the following in the <plugins>
section of the *.product
:
<plugin id="org.eclipse.justj.openjdk.hotspot.jre.full"/>
Note in particular that the plugin requires its OS-specific fragments, filtered of course so that only the appropriate one is actually installed.
Of course you must specify the update site that contains this JRE and naturally you can choose the specific JRE most suitable for the needs and size constraints of your specific product, e.g.,
https://download.eclipse.org/justj/sandbox/jres/14/updates/nightly/latest
There is a forum thread
and a mailing list thread recording the experience of others who have experimented with this.
The Tycho/Maven build must use Tycho 1.7.0 or higher, otherwise the build will fail with a NullPointerException
.
The JustJ JREs have explicit negative requirements to exclude a.jre
and a.jre.javase
from consideration during resolution;
this is to ensure that only the actual executation environments and Java packages provided by the real JRE are used for resolution.
Tycho currently has problems dealing with this but work is being done to address that.
In the meantime, one must either disable the use of the executation enviroment constraints during resolution, or disable the negative requirements themselves:
<build> <pluginManagement> <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>target-platform-configuration</artifactId> <version>${tycho-version}</version> <configuration> <target> ... </target> <resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints> <environments> .. </environments> <dependency-resolution> <profileProperties> <org.eclipse.justj.buildtime>true</org.eclipse.justj.buildtime> </profileProperties> </dependency-resolution> </configuration> </plugin> </plugins> </pluginManagement> </build>
The former must be used if you specify the target platform using a <target>
as opposed to merely providing <repositories>
.
If you have problems and need help, don't be afraid to ask. Community feedback is welcome. Please use Bug 562908 for this purpose.
jdeps
Java's modularized architecture supports analyzing a jar's module dependencies using jdeps
.
With such an analysis it is possible to determine the reduced dependencies of a particular IDE or RCP distribution.
JustJ has automated this dependency analysis via the build-jres
job
which generates a detailed report.
Reducing the JRE size is particularly important for smaller applications such as the Eclipse Installer which is currently roughly 53MB in size. Shipping that with a 70MB JRE would be a significant bloat. Furthermore, most users treat it as disposable, repeatedly downloading a new one with each release. It is downloaded roughly 3 million times per release cycle.
The EPP Packages range from 155MB to 400MB in size. For this use case, size is much less of a concern. In addition, the majority of the users install using the installer rather than downloading EPP Packages. This has the advantage that the large JRE fragment will be in the shared bundle pool by default and can be reused across multiple installations; it needs to be updated only whenever there is a new Java release.
The result of this analysis is used to produce the JREs with .minimal
qualifier on the download site:
https://download.eclipse.org/justj/sandbox/jres/14/downloads/latest/
The .stripped
versions of these are less than 1/2 the size of the corresponding .full.stripped
version.
Some outstanding concerns that remain are of course the impact of what's excluded.
For example, if certain agents, e.g., jdk.hotspot.agent
, or jdk.jdwp.agent
are excluded, it will not be possible to use such a JRE for debugging.
Of course stripping also makes the JRE poor for debugging purposes and could lead to less informative stack traces.
The absence of the jdk.localedata
module might also be a concern if language translation support is needed.
Community feedback is welcome. Please use Bug 562908 for this purpose.
jre-gen
As described in the Automated JRE p2 Generation with .tools section of the main page,
the generation of a JRE p2 repository is fully automated,
driven by a justj.jregen
instance.
To drive a Maven/Tycho build, the required scaffolding is generated.
To understand this process better, consider that there is a single overall Model
as the root instance.
This Model
has JVM
children where each JVM
child is specific to a Java version, e.g., 14.0.1
.
Each JVM
instance in turn has Variant
children where each Variant
child is specific to a given os/arch
pair, e.g., win32/x86_64
.
As such, when the model is reconciled against a single JRE *.tar.gz
, a single JVM
child with a single Variant
child is induced.
As each additional *.tar.gz
is reconciled, it will induce a new JVM
instance only if it has a different name or is for a different Java version, e.g., 14.0.2
.
As such, we generally expect that each JVM
will end up with three Variant
children for the three supported os/arch
pairs
And we generally expect that we'll end up with more than one JVM
instance only because we have packaged different subsets of modules of the same Java version.
The structure below outlines and describes what is generated for a Model
with a single JVM
with a single Variant
.
Of course the pattern for additional JVM
s and Variant
s simple repeats the same pattern.
Each label is a link to an actual artifact from the most recent succesfull build, so you can inspect the contents.
jre-gen
- the root of the overall model scaffolding
features
- the folder for all the features; it will contain one feature per JVM
org.eclipse.justj.openjdk.hotspot.jre.full-feature
- the JRE-specific feature
.project
- the feature project information
build.properties
- the feature build properties
feature.properties
- the feature NLS properties
feature.xml
- the feature structural information; it includes one plugin and one or more of its corresponding fragments
p2.inf
- the directives for additional p2 feature metadata
pom.xml
- the feature POM
plugins
- the folder for all the plugins and fragments; it will contain one main plugin per JVM
and one or more fragments per Variant
org.eclipse.justj.openjdk.hotspot.jre.full
- the JRE-specific plugin
META-INF
- the plugin manifest folder
MANIFEST.MF
- the plugin manifest
eclipse.inf
- the plugin Tycho build information
p2.inf
- the directives for additional p2 plugin metadata
.project
- the plugin project information
about.html
- the branding HTML
about.ini
- the plugin branding initialization file
about.mappings
- the plugin branding mappings
about.properties
- the plugin branding properties
build.properties
- the plugin build properties
justj32.png
- the plugin/feature branding image
plugin.properties
- the plugin NLS properties
pom.xml
- the plugin POM
org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64
- the JRE-specific, os-specific fragment
.settings
- the fragment preferences folder
org.eclipse.pde.prefs
- the fragment PDE preferences
META-INF
- the fragment manifest folder
MANIFEST.MF
- the fragment manifest
eclipse.inf
- the fragment Tycho build information
p2.inf
- the directives for additional p2 fragment metadata
jre
- folder containing the actual JRE
.gitignore
- the Git ignore of the fragment's jre
folder
.project
- the fragment project information
about.html
- the branding HTML
about.mappings
- the fragment branding mappings
build.properties
- the fragment build properties
fragment.properties
- the fragment NLS properties
pom.xml
- the fragment's POM
releng
- the folder for the releng-related projects
org.eclipse.justj.parent
- the parent project containing the bulk of the Tycho build infrastructure
features
- the folder for the features POM which composes all the features
pom.xml
- the features POM
plugins
- the folder for the plugins POM which composes all the plugins and fragments
pom.xml
- the plugins POM
promotion
- the folder for the promotion POM which manages the promotion of the p2 update site to download.eclipse.org
pom.xml
- the promotion POM that uses org.eclipse.justj.p2
.project
- the parent project information
pom.xml
- the parent POM that composes all the other POMs
org.eclipse.justj.site
- the site project
.project
- the site project information
category.xml
- the site category with a single category for all features
pom.xml
- the site POM
site.properties
- the site properties
.gitignore
- the root Git ignore information
pom.xml
- the root POM