The Knopflerfish OSGi framework is available under a BSD style license.
All OSGi source files are copyright by OSGi, see separate copyright file. OSGi source files are individually marked as such.
Some individual bundles (SOAP, Jini, x10) which use external libraries may use different licenses. In these cases, the bundles contain the appropiate license file(s).

You can download either a complete installation, a binary installation or just the core framework.

knopflerfish_fullbin_osgi_$(VERSION).jar
(approx 2.5 MB)
Full binary framework and bundles. No source or docs. Self-extracting.
knopflerfish_osgi_$(VERSION).jar
(approx 7 MB)
Complete framework, including source code, docs and this web site. Self-extracting.
knopflerfish_bin_osgi_$(VERSION).jar
(approx 2 MB)
Core binary framework and some bundles. No source or docs. Self-extracting.
knopflerfish_osgi_tiny_$(VERSION).zip
(approx 200 kb)
Remotely loading framework, no source, no docs, just framework.jar and config files for loading all bundles from the web.
knopflerfish_opt_$(VERSION).jar
(approx 6.5 MB, including Apache Axis SOAP libraries)
A set of optional bundles, including SOAP support for any OSGi service. See SOAP readme for details. Also includes support for OSGi Metatype data and a desktop UI for CM. This download should be installed on top of a previous installation. Self-extracting.

The 1.3.1 release of Knopflerfish OSGi is mainly a maintenance release, containing fixes to framework startup and better support for CM. Also notably is support for uncopied references to file: bundles.

Nightly builds from the latest source are also available.

Installation instructions for the tiny, remotely loading framework

  1. Unzip the distribution zip file
  2. Execute framework.jar
        > cd knopflerfish.org/osgi
        > java -jar framework.jar
    
All bundles defined in remote-init.xargs will be loaded over the net. See below for details on .xargs files.

Installation instructions for the complete framework

You need at at least Java 1.2.2 to install the framework.

The Knopflerfish OSGi framework should be installed by simply running the distribution jar file, either by double-clicking on the distribution file, or by the command:
    > java -jar knopflerfish_osgi_<version>.jar
This will open an installation wizard for selection installation directory. Follow the on-screen instructions.

If you don't need the wizard, installation can also be done in batch mode, by entering the command:

    > java -jar knopflerfish_osgi_<version>.jar -batch
...or by simply unpacking the jar file manually. (WinZip is also capable of unpacking .jar files)

The framework can then be started either by double-clicking on the framework.jar executable jar file in the knopflerfish.org/osgi directory, or by entering the commands

    > cd knopflerfish.org/osgi
    > java -jar framework.jar

Customizing startup

The default installation starts the Knopflerfish OSGi Desktop and a set of useful bundles, but if you don't want this - just remove lines as:
    -istart  desktop/desktop.jar
from the init.xargs file.

The init.xargs file in the current directory is read for options when no options are given on the command line and the framework is started for the first time. Restarting the framework reads the restart.xargs file as default. Restart from xargs.init can be forced by removing the fwdir directory.

To get help on the framework options, start the framework with the help option.

    java -jar framework.jar -help
This typically prints this help screen (depending on version):

 Usage:  java [properties] org.knopflerfish.framework.Main [-init] [options]
      or java [properties] -jar framework.jar [-init] [options]

 Options:
   -exit          Exit the JVM process
   -help          Print this text and exit
   -readme        Print a longer startup readme and exit
   -version       Print version and exit
   -xargs file    Load more command line arguments from file
   -init          Start an empty platform
   -install URL   Install a bundle
   -istart URL    Install and start bundle
   -launch [id]   Launch framework (Default), id = bundle id BootManager
   -sleep SEC     Sleep a while before next command
   -shutdown      Shutdown framework
   -start ID      Start bundle
   -stop ID       Stop bundle
   -uninstall ID  Uninstall a bundle
   -update ID     Update a bundle
   -initlevel N   Set initial start level for installed bundles
   -startlevel N  Set start level of Start Level service

 The default directory used for storing bundle data is  "fwdir".

 See -readme option for details on startup, fwdir and .xargs files.
 
 Properties:

   org.osgi.framework.dir
     Where we store persistent data.
     Default: {defaultInstDir}/fwdir

   org.knopflerfish.gosg.jars
     Base URL for relative install commands
     Default: file:jars/*

   org.osgi.framework.system.packages
     List of packages exported from system classloader,
     other than java.* and org.osgi.framework

   org.osgi.framework.system.packages.file
     File containing list of packages exported from system
     classloader,
     other than java.* and org.osgi.framework

   org.knopflerfish.framework.debug.classloader
     Print debug information from classloader
     Default: false

   org.knopflerfish.framework.debug.errors
     Print all FrameworkEvents of type ERROR
     Default: false

   org.knopflerfish.framework.debug.packages
     Print debug information about packages
     Default: false

   org.knopflerfish.framework.debug.startlevel
     Print debug information about startlevel service
     Default: false

   org.knopflerfish.framework.debug.url
     Print debug information about URL services
     Default: false

   org.knopflerfish.framework.debug.ldap
     Print debug information about LDAP filters
     Default: false

   org.knopflerfish.framework.ldap.nocache
     Disable LDAP caching for simple filters. LDAP caching
     speeds up framework filters considerably, but uses
     more memory.

     Default: false

   org.knopflerfish.framework.bundlestorage
     Storage implementation for bundles
     [file, memory]
     Default: file

   org.knopflerfish.framework.bundlestorage.file.reference
     When using file bundle storage, file: URLs can optionally
     be referenced only, not copied to the persistant area.

     If set to true, file: URLs are referenced only.

     Default: false

   org.knopflerfish.framework.bundlestorage.file.unpack
     When using file bundle storage, bundle jars can be unpacked
     or copied as-is. Unpacking leads to faster restart and class loading
     but takes longer for initial startup.

     If set to true, unpack bundle jars.

     Default: true
      
   org.knopflerfish.framework.system.export.all_13
     Make system classloader export all standard JVM 1.3
     packages as javax.swing.*
     Default: false

   org.knopflerfish.verbosity
     Framework verbosity level. 0 means few messages
     Default: 0

   org.knopflerfish.startlevel.use
     Use the Start Level service.
     Default: true

   org.knopflerfish.startlevel.level
     level of start level service if used.
     Default: 1

   org.knopflerfish.startlevel.initlevel
     Initial start level of bundles if start level
     service if used.
     Default: 1

   java.security.manager
     Class name of security manager. If set to empty string, uses
     "java.lang.SecurityManager". If unset, do not use any security
     manager.

     Default: unset

   java.security.policy
     Security policy file. Used by the security manager.

     Default: unset

   org.knopflerfish.framework.version.fuzzy
     If set to true, consider package version numbers
      "x.y.0" = "x.y" 
     otherwise consider
      "x.y.0" > "x.y"

     Default: true


   org.knopflerfish.osgi.r3.testcompliant
     If set to "true", make sure that all test in the OSGi R3 test 
     suite pass, even if the tests are buggy and break the spec itself.

     This affects some very special (due to bugs in the test) handling 
     of filters and conflict between the spec concerning CM and the actual
     tests. Bundles knowning abouth these conflicts should check the 
     testcompliant flag and act appropiately.
    
     Default: false. 
     Default is a Good Thing since it means follow the spec, not the 
     buggy tests.

   org.knopflerfish.framework.restart.allow
     If set to "true", allow restart of framework by calling 
     getBundle(0).update()

     If "false", exit framework with exit code = 2. This can be useful
     when a wrapper script is better at restarting cleanly than the JVM
     itself.

     Default: true
  
  org.knopflerfish.osgi.setcontextclassloader
     If set to "true", set the bundle startup thread's context class
     loader to the bundle's class loader. This is useful for checking
     if an external lib will work better with a wrapped startup.
     
     Default: false


Knopflerfish framework.jar startup

This is a startup guide for the KF OSGi framework. Note that startup of the framework is not specified by OSGi, and system integrators often need to create a wrapper script for FW startup. The KF Main startup class is primarily intended to be used in scenarios where current working directory is same as the one containing framework.jar, the framework storage directory and configuration files. In these cases java -jar framework.jar ...is often enough. Other uses are possible, but require options and possibly some tweaking of the default startup files. Initial start vs restart ======================== Two cases of framework startup should be noted: 1. Initial, bootstrap, startup An initial startup must contains enough options to install bundles allowing further management, using -install options. If no bundles are installed, an empty framework will be started but nothing can be done with it.. 2. Restart of previously initialized framework. Any OSGi framework can remember its state from previous startup. In this case, startup options should only contains system properties and a -launch option for restarting the bundles, but not any -install options. NB! Since these two different cases probably will use separate startup files, care must be taken so system properties a set correctly in both files, when so required. It is up to a system integrator to decide when to use initial startup or restart. The Main KF class can help somewhat in doing this (see below) but might not be enough. In those cases, wrapper scripts, or modifications to Main.java are recommended. Starting the framework ====================== The framework can be started using the startup wrapper class org.knopflerfish.framework.Main This class is also set a Main-Class in framework.jar's manifest, meaning framework.jar can be started using java -jar framework.jar [options] The Main class supports a number of options, which can be displayed using java -jar framework.jar -help Options can also be specified using the -xargs option, which specifies a .xargs text file containing lines of new options. Typically all options are specified in .xargs files. Combining .xargs files and command line options is possible but not recommended. .xargs files can also use recursive .xargs files. When the framework is started, it uses a file system directory for storing the state of all installed bundles, "fwdir". The default directory used for this is fwdir in the currect directory. The "fwdir" directory can also be set specifically using the org.osgi.framework.dir system property. Note that moving "fwdir" also changes the location for searching for default .xargs files. If no options are specified, or a single "-init" option is present, an implicit -xargs "default" is added to the options. "default" means that the default .xargs (see below) is selected. Default selection of .xargs =========================== If _no_ args are supplied, or a name of "default" is given as -xargs argument, a default .xargs file will be searched for, by the following algorithm: 1. If there exists a previous "fwdir" AND previous options does not contain "-init", use restart.xargs ...in the same dir as "fwdir". 2. If no fwdir exist, OR options contain an "-init", try the first file matching: a) init_[osname].xargs b) init.xargs c) remote-init.xargs ...in the same dir as "fwdir" [osname] is the unified OS name as specified in Alias.java (see below). Case is important if the file system is case sensitive. OS aliases: OS2 QNX Windows95 Windows98 WindowsNT WindowsCE Windows2000 WindowsXP