This is the documentation of the Eclipse Equinox Framework.
p2 (Provisioning Platform) is Eclipse’s install and update mechanism. This guide covers how to use p2’s administrative functions from the command line with the Equinox Launcher, which is useful for automated installations, updates, and maintenance.
p2 is the Eclipse provisioning platform that:
The p2 director is a headless application for provisioning operations:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU org.eclipse.jdt.feature.group
| Argument | Description | Example |
|---|---|---|
-repository |
Comma-separated repository URLs | -repository http://site1,http://site2 |
-installIU |
Installable Unit (IU) to install | -installIU org.eclipse.jdt.feature.group |
-uninstallIU |
IU to uninstall | -uninstallIU org.eclipse.mylyn.feature.group |
-destination |
Installation destination | -destination /path/to/eclipse |
-profile |
Profile name | -profile SDKProfile |
-profileProperties |
Profile properties | -profileProperties org.eclipse.update.install.features=true |
-bundlepool |
Bundle pool location | -bundlepool /shared/bundles |
-p2.os |
Target OS | -p2.os linux |
-p2.ws |
Target windowing system | -p2.ws gtk |
-p2.arch |
Target architecture | -p2.arch x86_64 |
-roaming |
Create roaming profile | -roaming |
-list |
List installed IUs | -list |
-listTags |
List available tags | -listTags |
-tag |
Tag this operation | -tag MyTag |
Install a feature into an existing Eclipse:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/2023-12 \
-installIU org.eclipse.jdt.feature.group \
-destination /opt/eclipse \
-profile SDKProfile
Install multiple features at once:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/2023-12 \
-installIU org.eclipse.jdt.feature.group,org.eclipse.pde.feature.group,org.eclipse.cdt.feature.group \
-destination /opt/eclipse \
-profile SDKProfile
Remove installed features:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-uninstallIU org.eclipse.mylyn.feature.group \
-destination /opt/eclipse \
-profile SDKProfile
List all installed IUs:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-list \
-destination /opt/eclipse \
-profile SDKProfile
Create a new Eclipse installation from scratch:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/2023-12 \
-installIU org.eclipse.platform.ide \
-destination /opt/new-eclipse \
-profile SDKProfile \
-roaming
Use comma-separated list for multiple repositories:
-repository http://download.eclipse.org/releases/latest,http://example.com/updates
Use file:// URLs for local repositories:
-repository file:///home/user/local-repo
Cache repository metadata for offline use:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.cache \
-repository http://download.eclipse.org/releases/latest
A profile represents an installation instance. Key concepts:
SDKProfile, _SELF_)Use _SELF_ as the profile name to modify the running Eclipse:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU org.eclipse.jdt.feature.group \
-profile _SELF_
Use a shared bundle pool for multiple installations:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU org.eclipse.platform.ide \
-destination /opt/eclipse-instance1 \
-bundlepool /shared/eclipse-bundles \
-profile Instance1Profile
Install a specific version:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/2023-12 \
-installIU org.eclipse.jdt.feature.group/4.30.0 \
-destination /opt/eclipse \
-profile SDKProfile
Install for a different platform:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU org.eclipse.platform.ide \
-destination /opt/eclipse-linux-arm \
-profile SDKProfile \
-p2.os linux \
-p2.ws gtk \
-p2.arch aarch64
Verify an installation without modifying it:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU org.eclipse.jdt.feature.group \
-destination /opt/eclipse \
-profile SDKProfile \
-verifyOnly
Use tags to mark and revert installations:
# Tag current state
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-tag BeforeUpdate \
-destination /opt/eclipse \
-profile SDKProfile
# Install updates
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU org.eclipse.jdt.feature.group \
-destination /opt/eclipse \
-profile SDKProfile
# Revert if needed
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-revert BeforeUpdate \
-destination /opt/eclipse \
-profile SDKProfile
Create a local mirror of a repository:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \
-source http://download.eclipse.org/releases/2023-12 \
-destination file:///local/mirror/2023-12
Mirror only metadata (not artifacts):
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.metadata.repository.mirrorApplication \
-source http://download.eclipse.org/releases/2023-12 \
-destination file:///local/metadata/2023-12
Example script for automated installation:
#!/bin/bash
set -e
ECLIPSE_HOME="/opt/eclipse"
INSTALL_DIR="/opt/new-eclipse"
REPO_URL="http://download.eclipse.org/releases/2023-12"
# Features to install
FEATURES=(
"org.eclipse.platform.ide"
"org.eclipse.jdt.feature.group"
"org.eclipse.pde.feature.group"
"org.eclipse.m2e.feature.feature.group"
)
# Create comma-separated list
IU_LIST=$(IFS=,; echo "${FEATURES[*]}")
# Perform installation
"${ECLIPSE_HOME}/eclipse" \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository "${REPO_URL}" \
-installIU "${IU_LIST}" \
-destination "${INSTALL_DIR}" \
-profile SDKProfile \
-roaming \
-consoleLog
echo "Installation complete: ${INSTALL_DIR}"
Script to update an existing Eclipse:
#!/bin/bash
set -e
ECLIPSE_HOME="/opt/eclipse"
# Create backup tag
"${ECLIPSE_HOME}/eclipse" \
-nosplash \
-application org.eclipse.equinox.p2.director \
-tag "backup-$(date +%Y%m%d-%H%M%S)" \
-profile _SELF_
# Update all installed features
"${ECLIPSE_HOME}/eclipse" \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-profile _SELF_ \
-list | grep "feature.group" | cut -d= -f1 | while read -r feature; do
echo "Updating: ${feature}"
"${ECLIPSE_HOME}/eclipse" \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU "${feature}" \
-profile _SELF_
done
echo "Update complete"
Dockerfile for Eclipse with specific features:
FROM ubuntu:22.04
# Install dependencies
RUN apt-get update && apt-get install -y \
wget \
libgtk-3-0 \
openjdk-17-jdk
# Download Eclipse
RUN wget https://download.eclipse.org/eclipse/downloads/.../eclipse-platform.tar.gz \
&& tar -xzf eclipse-platform.tar.gz -C /opt
# Install features via p2
RUN /opt/eclipse/eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/2023-12 \
-installIU org.eclipse.jdt.feature.group,org.eclipse.pde.feature.group \
-destination /opt/eclipse \
-profile SDKProfile
# Set environment
ENV PATH="/opt/eclipse:${PATH}"
CMD ["eclipse"]
Jenkinsfile for provisioning Eclipse:
pipeline {
agent any
environment {
ECLIPSE_HOME = '/opt/eclipse'
REPO_URL = 'http://download.eclipse.org/releases/2023-12'
}
stages {
stage('Provision Eclipse') {
steps {
sh """
${ECLIPSE_HOME}/eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository ${REPO_URL} \
-installIU org.eclipse.jdt.feature.group \
-destination ${WORKSPACE}/eclipse-install \
-profile SDKProfile \
-roaming
"""
}
}
}
}
Error: “Application not found: org.eclipse.equinox.p2.director”
Solution: Ensure p2 plugins are present:
org.eclipse.equinox.p2.directororg.eclipse.equinox.p2.director.appError: “Unable to connect to repository”
Solutions:
-vmargs -Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=8080Error: “Cannot complete the install because of missing dependencies”
Solutions:
-list to see what’s already installedError: “Profile is locked”
Solution: Another process is using the profile. Close other Eclipse instances or wait for operations to complete.
Enable p2 debugging:
eclipse \
-nosplash \
-application org.eclipse.equinox.p2.director \
-repository http://download.eclipse.org/releases/latest \
-installIU org.eclipse.jdt.feature.group \
-destination /opt/eclipse \
-profile SDKProfile \
-consoleLog \
-vmargs \
-Dorg.eclipse.equinox.p2.core.debug=true
Increase logging verbosity:
-vmargs \
-Dorg.eclipse.equinox.p2.director.debug=true \
-Dorg.eclipse.equinox.p2.engine.debug=true
-consoleLog for debuggingFor programmatic p2 operations, use the p2 API:
IProvisioningAgent agent = ServiceHelper.getService(
Activator.getContext(),
IProvisioningAgentProvider.class
).createAgent(location);
IProfileRegistry profileRegistry = (IProfileRegistry)
agent.getService(IProfileRegistry.SERVICE_NAME);
IProfile profile = profileRegistry.getProfile(profileId);
// Perform provisioning operations
Features typically use .feature.group suffix:
org.eclipse.jdt.feature.group - JDTorg.eclipse.pde.feature.group - PDEorg.eclipse.platform.ide - Platform IDEhttp://download.eclipse.org/releases/latesthttp://download.eclipse.org/releases/2023-12http://download.eclipse.org/eclipse/updates/http://download.eclipse.org/tools/orbit/downloads/