Java

Java

Java

Topics on Semeru (Java) on IBM Z

 View Only
Expand all | Collapse all

JZOS from maven-central cannot be used with Java8

  • 1.  JZOS from maven-central cannot be used with Java8

    Posted Fri November 10, 2023 01:25 AM

    Hi, 

    Hopefully this is the right forum for such a question.

    We're trying to use JZOS from maven-central (https://mvnrepository.com/artifact/com.ibm.jzos/ibm.jzos) for compilation purposes.

    The jar seems to have been compiled using Java 11 which prevents us from using it in Java 8 applications.

    Can a Java 8 compiled jar be published as well?

    Thanks,

    Roded



    ------------------------------
    Roded Bahat
    ------------------------------


  • 2.  RE: JZOS from maven-central cannot be used with Java8

    Posted Fri November 10, 2023 04:08 PM


    ------------------------------
    Min Su Cho
    ------------------------------



  • 3.  RE: JZOS from maven-central cannot be used with Java8

    Posted Sat November 11, 2023 11:22 AM

    Thanks for the reply Min Su Cho.

    We're using Gradle to compile a project which uses a Java 8 toolchain and which has JZOS as a compileOnly dependency the following error is reported:

    import com.ibm.jzos.ZFile;
                       ^
      bad class file: /Users/rbahat/.gradle/caches/modules-2/files-2.1/com.ibm.jzos/ibm.jzos/3.1.3.1/93747a6959750874af749886c1cb5e0b38eb4059/ibm.jzos-3.1.3.1.jar(com/ibm/jzos/ZFile.class)
        class file has wrong version 55.0, should be 52.0
        Please remove or make sure it appears in the correct subdirectory of the classpath.

    This is a error coming from Java8's javac.

    And it does seem like the JZOS classes have been compiled with 55.

    Please advise.

    Thanks



    ------------------------------
    Roded Bahat
    ------------------------------



  • 4.  RE: JZOS from maven-central cannot be used with Java8

    Posted Fri November 17, 2023 10:29 AM

    Thank you Roded Bahat for posting the error message.

    I have gone through the Gradle build from my end and other build tools. We don't officially support Gradle and only encourage using Maven and manual importing at the moment. What I can suggest for now is to use other build tools.

    Please let me know if the issue persists even after you change the build tool.

    Thank you

    Kevin



    ------------------------------
    Min Su Cho
    ------------------------------



  • 5.  RE: JZOS from maven-central cannot be used with Java8

    Posted Fri November 17, 2023 12:27 PM

    That's very disappointing Kevin.

    Using a different build tool is definitely not an option. And I'm not sure what you mean by "manual importing". We would like to be able to compile against JZOS just like any other jar avaliable in maven central.

    This isn't really a matter of officially supporting Gradle vs Maven, but rather, just providing a JZOS jar which has been compiled using Java 8.

    Can't IBM provide a JZOS jar which has been compiled with Java 8? This could even be an older version of JZOS if the current version requires Java 11 language features.

    Thanks.



    ------------------------------
    Roded Bahat
    ------------------------------



  • 6.  RE: JZOS from maven-central cannot be used with Java8

    Posted Tue December 12, 2023 01:02 PM
    Edited by James Tang Tue December 12, 2023 01:07 PM

    The team has been looking into a v8 of JZOS jar to Maven. This is being considered in prioritization backlog.

    To help with this prioritization, please open a RFE here - https://ibm-z-software-portal.ideas.ibm.com/?project=JSDK4Z



    ------------------------------
    James Tang
    ------------------------------



  • 7.  RE: JZOS from maven-central cannot be used with Java8

    Posted Tue December 12, 2023 03:50 PM

    That's great to hear. We're looking forward to using JZOS from maven central. 

    Thanks James.



    ------------------------------
    Roded Bahat
    ------------------------------



  • 8.  RE: JZOS from maven-central cannot be used with Java8

    Posted Thu January 04, 2024 02:09 PM

    Hello Kevin,

    I am using Maven build tool and I am getting same error. 

    According to documentation (Managing IBM JZOS dependencies by using Maven - IBM Documentation) we need JZOS 2.4.11.X. 

    This is version is not available on the Maven central. Do you have this version in any place we can use ? 

    Regards,

    Reddy.



    ------------------------------
    Srinivasa Bommareddy
    ------------------------------



  • 9.  RE: JZOS from maven-central cannot be used with Java8

    Posted Thu January 04, 2024 02:10 PM

    Hello Kevin,

    I am using Maven build tool and getting same error. 

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project mfRestAPIUtils: Compilation failure
    [ERROR] /C:/Dev/Code/ASP/mfRestAPIUtils/src/main/java/com/rtc/mf/utils/cics/CustDB.java:[7,22] cannot access com.ibm.jzos.fields.CobolDatatypeFactory
    [ERROR]   bad class file: c:\dev\devtools\cache\m2_repository\com\ibm\jzos\ibm.jzos\3.1.3.1\ibm.jzos-3.1.3.1.jar(com/ibm/jzos/fields/CobolDatatypeFactory.class)
    [ERROR]     class file has wrong version 55.0, should be 52.0
    [ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.
    [ERROR]

    According to IBM documentation (https://www.ibm.com/docs/en/semeru-runtime-ce-z/11?topic=guide-managing-jzos-dependencies-by-using-maven)  we need to use version 2.4.11.x for Java 8. This version is not available in Maven central. Only version on maven central is 3.1.3.1.

    Can you please pint me the location where I can get 2.4.11.x

    Regards,
    Reddy



    ------------------------------
    Srinivasa Bommareddy
    ------------------------------



  • 10.  RE: JZOS from maven-central cannot be used with Java8

    Posted Mon February 12, 2024 11:06 AM

    Hello Srinivasa,

    We released JZOS on Maven for Java 8.

    Here is the IBM documentation (https://www.ibm.com/docs/en/sdk-java-technology/8?topic=components-managing-jzos-dependencies-by-using-maven) for Java 8 JZOS Maven.

    We're looking to adjust and align artifact naming for JZOS on Maven, so they provide a better UX for our users.

    Regards,

    Kevin



    ------------------------------
    Min Su Cho
    ------------------------------



  • 11.  RE: JZOS from maven-central cannot be used with Java8

    Posted Wed March 27, 2024 12:47 PM

    Hello Roded and Srinivasa,

    I created a blog post regarding the JZOS on Maven. Feel free to ping me or leave a comment if you have concerns or questions.

    https://community.ibm.com/community/user/ibmz-and-linuxone/blogs/min-su-cho/2024/03/20/jzos-on-maven

    Thank you 



    ------------------------------
    Min Su Cho
    ------------------------------



  • 12.  RE: JZOS from maven-central cannot be used with Java8

    Posted Tue April 02, 2024 02:24 AM

    Hi Min Su Cho,

    Very cool. Much appreciated!



    ------------------------------
    Roded Bahat
    ------------------------------