• 1 reply
  • Latest Post - ‏2013-07-03T09:57:02Z by Ben Cox
1 Post

Pinned topic How to define an Export package

‏2013-04-17T19:03:15Z |

I am new to the CICS Explorer SDK and java programming.  I am trying to change our Java programs that were written a long time ago in order to run them in a CICS 5.1 environment for testing.  I am following a draft copy of redbook to try the migration.    I used the Plug-in from existing JAR Archives option to create a OSGi package.   When I edit the MNIFEST.MF (as shown below), the Export-Package field is blank.   Does any one know how to define an export-package?   

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TESTJAVA
Bundle-SymbolicName: TESTJAVA
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Export-Package: ;version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
CICS-MainClass:  .......

  • Ben Cox
    Ben Cox
    13 Posts

    Re: How to define an Export package


    Using the "Plug-in from existing JAR Archives" wizard, I'd expect the packages from your JAR to be added to the Export-Package statement. Given you only seem to have an empty package name, a question occurs to me - are the classes from your JAR in the default package (i.e. in no particular package)? OSGi requires that you divide things properly into packages (use of the default package being discouraged in Java).

    If you're dealing with .java source files, you can create new packages by right-clicking the source folder and selecting New -> Package. Package names are generally lower-case and dot-notated, so something like "org.example.test" will do nicely. Once you've created the package, drag your source files into the package. You can then modify your Export-Package statement to look something like this:

    Export-Package: org.example.test;version="1.0.0"

    Note that you are not required to use Export-Package if you're just using CICS-MainClasses in that bundle. Only if another bundle wanted to call into packages from your bundle would you be required to export those packages.

    Updated on 2013-07-03T09:59:07Z at 2013-07-03T09:59:07Z by Ben Cox