eclipsemainframezoscics

"The import com.ibm.jzos cannot be resolved" when exporting CICS bundle to z/OS UNIX File System


I'm trying to export a CICS bundle to a z/OS Unix file system using IBM Developer for z/OS.

One of the projects in my bundle has a library I'm importing (ibmjzos-2.4.11.3.jar). I added the library to the lib folder and have added it as an external jar in my project settings under Java Build Path > Libraries. The project builds with no errors.

When I right click on the bundle and "Export Bundle Project to z/OS Unix File System", I select the path where I want the bundle exported to and click Finish.

I'm then met with

 Error occurred performing plugin export.  Please check the log file for further details: C:\Users\chris\AppData\Local\Temp\explorer1739468339578\logs.zip

The contents of which are:

# 2/13/25 12:39:03 PM EST
# Eclipse Compiler for Java(TM) v20180528-0519, 3.14.0, Copyright IBM Corp 2000, 2015. All rights reserved.
----------
1. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 21)
    import com.ibm.jzos.Exec;
           ^^^^^^^^^^^^
The import com.ibm.jzos cannot be resolved
----------
2. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 22)
    import com.ibm.jzos.RcException;
           ^^^^^^^^^^^^
The import com.ibm.jzos cannot be resolved
----------
3. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 23)
    import com.ibm.jzos.ZUtil;
           ^^^^^^^^^^^^
The import com.ibm.jzos cannot be resolved
----------
4. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 68)
    Exec exec = new Exec(getStatusCommand(job), getEnvironment());
    ^^^^
Exec cannot be resolved to a type
----------
5. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 68)
    Exec exec = new Exec(getStatusCommand(job), getEnvironment());
                    ^^^^
Exec cannot be resolved to a type
----------
6. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 84)
    throw new RcException("REXX 'jobStatus' process failed: " + line, rc);
              ^^^^^^^^^^^
RcException cannot be resolved to a type
----------
7. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 150)
    Exec exec = new Exec(getJobOutputCommand(mvsJob), getEnvironment());
    ^^^^
Exec cannot be resolved to a type
----------
8. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 150)
    Exec exec = new Exec(getJobOutputCommand(mvsJob), getEnvironment());
                    ^^^^
Exec cannot be resolved to a type
----------
9. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 165)
    throw new RcException("REXX 'jobOutput' process failed", rc);
              ^^^^^^^^^^^
RcException cannot be resolved to a type
----------
10. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 197)
    Properties p = ZUtil.getEnvironment();
                   ^^^^^
ZUtil cannot be resolved
----------
11. ERROR in C:\Users\chris\src\com.ibm.cics.server.examples.hello\src\examples\hello\MvsJobOutput.java (at line 204)
    for (Iterator<Object> iter = p.keySet().iterator(); iter.hasNext();) {
                  ^^^^^^
Syntax error, parameterized types are only available if source level is 1.5 or greater
----------
11 problems (11 errors)

The root problem appears to me that the com.ibm.jzos library is not being included when bundled. How do I fix the libraries when the bundle is being exported?


Solution

  • It sounds like you are attempting to add the jzos library into your OSGi bundle in the lib folder. Normally what we would expect to do is a wrapper OSGi bundle that is used within the IDE. This wrapper bundle exports the com.ibm.jzos classes and your bundle imports them. This should allow the compiling and IDE to be happy.

    For full instructions have a look at https://www.ibm.com/docs/en/cics-ts/6.x?topic=djariojs-developing-java-applications-use-jzos-toolkit-api-in-osgi-jvm-server