Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To compile these classes you will need to have the framework.jar file org.apache.felix.framework-x.y.z.jar and org.apache.felix.shell-x.y.z.jar on your class path. Compile all of the source files using a command like:

No Format
java -cp org.apache.felix.framework-1.8.1.jar:org.apache.felix.shell-1.2.0.jar -d c:\classes *.java

This command compiles all of the source files and outputs the generated class files into a subdirectory of the c:\classes directory, called test, named after the package of the source files; for the above command to work, the c:\classes directory must exist. Once you have compiled all of the above classes, you need to create a bundle JAR file of the generated package directory. The bundle JAR file needs a manifest, so create a file called manifest.mf with the following contents:

Code Block
Bundle-Name: My Start Command
Bundle-Description: A 'start' command for the shell service.
Bundle-Activator: test.MyStartActivator
Bundle-ClassPath: .
Import-Package: org.apache.felix.shell,org.osgi.framework

To create the bundle JAR file, issue the command:

...