Skip to content

Instantly share code, notes, and snippets.

@qkaiser
Created January 31, 2018 15:32
Show Gist options
  • Save qkaiser/66c8a618eef2a7801c0bbb1aa43d724a to your computer and use it in GitHub Desktop.
Save qkaiser/66c8a618eef2a7801c0bbb1aa43d724a to your computer and use it in GitHub Desktop.
Eclipse Equinoxe OSGi Console - Standalone setup script
#!/bin/bash
SDK_SHA512="02c6e8abbfa05072fbc139bc6c1d88245338631e7fa2776cbb2097ff1989fc6af595049a1bf7223dc0d39aa2bb1f31394cbadbcec45aa343d133f9f360675f99"
SDK_DOWNLOAD_LINK="https://www.eclipse.org/downloads/download.php?file=/equinox/drops/R-Oxygen.2-201711300510/equinox-SDK-Oxygen.2.zip&r=1"
SDK_FILENAME="equinox-SDK-Oxygen.2.zip"
echo "[+] Downloading SDK ..."
wget -q $SDK_DOWNLOAD_LINK -O $SDK_FILENAME
echo "[+] Checking checksums ..."
echo "$SDK_SHA512 $SDK_FILENAME" | sha512sum -c -
if [ $? -ne 0 ]; then
echo "[!] Checksum mismatch. Aborting."
exit 1
fi
echo "[+] Writing configuration file ..."
mkdir -p configuration
touch configuration/config.ini
cat > configuration/config.ini <<EOF
osgi.bundles=org.eclipse.equinox.console@start, org.apache.felix.gogo.command@start, org.apache.felix.gogo.shell@start, org.apache.felix.gogo.runtime@start
eclipse.ignoreApp=true
osgi.noShutdown=true
EOF
echo "[+] Extracting required JAR files ..."
unzip -p $SDK_FILENAME "plugins/org.apache.felix.gogo.command_*.jar" > org.apache.felix.gogo.command.jar
unzip -p $SDK_FILENAME "plugins/org.apache.felix.gogo.runtime_*.jar" > org.apache.felix.gogo.runtime.jar
unzip -p $SDK_FILENAME "plugins/org.apache.felix.gogo.shell_*.jar" > org.apache.felix.gogo.shell.jar
unzip -p $SDK_FILENAME "plugins/org.eclipse.equinox.console_*.jar" > org.eclipse.equinox.console.jar
unzip -p $SDK_FILENAME "plugins/org.eclipse.osgi_*.jar" > org.eclipse.osgi.jar
echo "[+] Creating plugins directory ..."
mkdir -p plugins
echo "[+] Done. You can launch OSGi with java -jar org.eclipse.osgi.jar -console <port>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment