CJRE or MJRE for certain platforms can come preconfigured with an Equinox (OSGI R4 core framework implementation), a set of bundles that implement various optional OSGI services and other infrastructure for running OSGI-based systems.  Here, we present a short guide to installing and verifying basic operation of Equinox on JRE.

Installation.

  • the preconfigured Equinox is released as a set of several files
    • j9-equinox_$date.tgz - Equinox binary and configuration files that should be placed on the target system
    • provisioner-$os.$arch_$date.tgz - host-side GUI tool used by the example program

Setting up Equinox.

  • extract j9-equinox*.tgz archive on the target system
  • setup $JAVA_HOME environment variable to reflect location of installed JRE
  • setup $EQUINOX_HOME environment variable to reflect location of installed j9-equinox package
  • modify configuration files ($equinox/configuration/config.ini) to reflect your setup
  • start equinox on the target (console mode):
    • % $JAVA_HOME/bin/j9 -jar $EQUINOX_HOME/bundles/org.eclipse.osgi_3.6.0*.jar -console -configuration $EQUINOX_HOME/configuration
    • osgi> ss  
      • above command will show any bundles currently installed/active (should be at least one)

Running sample OSGI applications.

The j9-equinox*.tgz package comes with a simple OSGI application that demonstrates basic functionality.
  • extract j9-equinox*.tgz archive on the target system
  • setup $JAVA_HOME environment variable to reflect location of installed JRE
  • setup $EQUINOX_HOME environment variable to reflect location of installed j9-equinox package
    • % cd $EQUINOX_HOME/examples/webapp/bin
    • % ./webapp
    • osgi> ss
      • above command will show 4 ACTIVE and 2 RESOLVED bundles

Using provisioner to install/control sample OSGI applications.

After 'webapp' application is running, a host-side GUI can be used to install additional bundles.  These bundles were written by Apogee and are used to display the basic functionality, as well as features of OSGI framework.
  • on the host system extract provisioner*.tgz that is applicable to your platform
    • % cd provisioner
    • % ./eclipse 
  • select 'File'->'Push Equinox Bundle' 
  • fill in 'Device Name or IP Address' box, reflecting network address of the target system ($TARGET_IP)
  • select one at a time (in order) first 4 bundles and press 'Push Bundle' which will install them onto the target
    • do not install (yet) the last one as we will install it later
  • using a web browser on the host, visit http://$TARGET_IP:7777/home which will show a webpage showing status information for installed bundles.  The functionality displayed by each of the tabs there is provided by a separate OSGI bundle (installed in the previous step).
Sample 'webapp' application and supporting bundles also provide a functionality for installing additional OSGI bundles through a web interface (instead of using provisioner GUI).  To demonstrate this functionality (using the last sysinfo bundle, which we did not install above):
  • using a web browser on the host, visit http://$TARGET_IP:7777/home
  • select 'OSGI Equinox Admin' tab
  • select 'Install/Update' on the left sidebar
  • replace 'rhel' with the IP address of the host machine and click 'Next'
  • 'install' link will be shown next to com.apogee.equinox.sysinfo.webapp bundle
  • after installation, a 'System Information' tab will be available, displaying information generated by sysinfo bundle.