CLASSPATH issue in AS/400 for JAR files

125 pts.
Tags:
AS/400
JAR files
Java
Hi, I am getting Exception in thread "main" java.util.zip.ZipException: error in opening zip file when I try to execute my jar file. The issue is only with jar file, class files are getting executed.
For ex: when I fire the command JAVA CLASS(abc.jar) it fails stating the above error.
When I fire the command JAVA CLASS(Hello), it completed successfully.
My jar files are under a folder myFolder.
CLASSPATH is /myFolder.
Any idea what might be happening here?


Software/Hardware used:
AS400, JTOpen
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    We can't tell you how to set your CLASSPATH until you tell us (1) all of the classes used in your code, and (2) where all of those classes can be found on your system.

    Most likely, your "Hello" only references objects found in /myFolder plus whatever your default CLASSPATH provides. If you are running the JAVA CL command exactly as shown in your question, then you need to specify the CLASSPATH() parameter so that all referenced classes are found. Alternatively, you might use ADDENVVAR to set your job's CLASSPATH.
    36,370 pointsBadges:
    report
  • Pranav0712
    Thank you.

    Here is my classpath:
    .:/pdjava/commons-codec-1.3.jar:/pdjava/commons-httpclient.jar:/pdjava/commons-logging-1.1.jar:/pdjava/commons-logging-adapters-1.1.jar:/pdjava/commons-logging-api-1.1.jar:/pdjava/httpclient-4.3.6.jar:/pdjava/httpcore-4.3.3.jar:/pdjava/msgIntegration.jar:/pdjava/jt400.jar:/pdjava/messagerelay.jar:/pdjava/messageclient.jar


    WHERE msgIntegration.jar, messagerelay.jar, messageclient.jar are my custom jar's. Rest all are third party binaries.

    All the jars are inside /pdjava.

    I have set the CLASSPATH at *SYS level using the command CHGENVVAR.
    125 pointsBadges:
    report
  • TheRealRaven
    Where is "abc.jar"?
    36,370 pointsBadges:
    report
  • Pranav0712
    I quoted that as an example. I am actually trying to execute messageclient.jar.
    JAVA CLASS(messageclient.jar)

    Snapshot of manifest:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.8.2
    Created-By: 1.8.0_25-b18 (Oracle Corporation)
    Main-Class: MessageClient
    Class-Path: commons-codec-1.3.jar msgIntegration.jar
    httpcore-4.1.2.jar httpclient-4.1.2.jar commons-logging-api-1.1.jar
    commons-logging-adapters-1.1.jar commons-logging-1.1.jar commons-httpclient.jar jt400.jar



    125 pointsBadges:
    report
  • Pranav0712
    I identified today that on my other machine where JDK version 1.8 is installed I am getting FileNotFoundException (A file or directory in the path name does not exist).

    125 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: