admin管理员组文章数量:1291037
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?
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?
Share Improve this question asked Feb 13 at 17:46 rockzombie2rockzombie2 2,9254 gold badges18 silver badges20 bronze badges 4 |3 Answers
Reset to default 1It 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/docs/en/cics-ts/6.x?topic=djariojs-developing-java-applications-use-jzos-toolkit-api-in-osgi-jvm-server
The jar you are referencing I believe is a stub library so that jzos can be referenced in IDEs but does not contain the complete classes. The JZOS library is present in z/OS Java but not as a jar you can download.
For instance, I've downloaded the jar your referencing to my local system for development so I can reference the classes and methods during development on my Mac but I do not need to package that jar as it exists in the Java distribution on z/OS.
JZOS is a collection of Java classes and native code so the library you are referencing is a convenience jar for development and not execution.
Getting the classpaths right when creating Eclipse projects can get tricky when trying to export them, and trickier still when trying to create CI builds to do the same thing.
If you were instead building your application with Maven or Gradle, you would avoid this work and inconsistencies. However, there are some things you could still trip over. Here are some hints and tips.
Get hold of JZOS
The stub of JZOS is findable on Maven Central and can be mirrored to downstream internal repositories like Artifactory and Nexus. Its coordinates are:
com.ibm.jzos:ibmjzos
for Java 8com.ibm.jzos:ibm.jzos
for Java 11 and beyond, when JZOS becomes a Java module.
You can work out exactly which version you need using pages like Managing IBM JZOS dependencies by using Maven.
Make sure you don't package JZOS
JZOS is included within the JVM and available on the classpath automatically. To avoid inconsistencies, you want it to not be packaged into your application. You do this with the Maven scope:
<dependencies>
<dependency>
<groupId>com.ibm.jzos</groupId>
<artifactId>ibm.jzos</artifactId>
<version>3.1.3.3</version>
<scope>provided</scocpe>
</dependency>
</dependencies>
Or the Gradle configuration name:
dependencies {
compileOnly "com.ibm.jzos:ibm.jzos:3.1.3.3"
}
Create and deploy the CICS bundle
The creation of the CICS bundle can be automated using the CICS bundle Maven plugin or CICS bundle Gradle plugin.
Either plugin offers the opportunity to create a module which is the CICS bundle and pulls in other modules, or to simply turn an existing Java module into a CICS bundle.
You can even do the deployment directly to your development CICS region in Maven or Gradle, which is a big time saver.
本文标签:
版权声明:本文标题:eclipse - "The import com.ibm.jzos cannot be resolved" when exporting CICS bundle to zOS UNIX File System - St 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741511762a2382646.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
Syntax error, parameterized types are only available if source level is 1.5 or greater
. What's your project setting for this (1.5 means Java 5 which is outdated for years)? I don't know the "Export Bundle Project to z/OS Unix File System" function since it is not standard Eclipse. The log saysEclipse Compiler for Java(TM) v20180528-0519, 3.14.0
(v20180528...
means May 28, 2018) which is almost 7 years behind and won't work with recent Java versions. – howlger Commented Feb 13 at 19:22