ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Classpath issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Classpath issue

    We are having an issue with user running a program that use Java and set classpaths, then call another program that use different Java classes and need a different classpath. From what I understand, when the JVM is started, it pulls in the environment variables. Then, any subsequent setting of these environment variables are ignored until the job ends. And I have also read that it is impossible to end and restart the JVM without ending the job.

    Any thoughts on the proper way(if there is one) to handle this. We are on 7.1.

    John

  • #2
    Re: Classpath issue

    if possible submit the 2nd program as a separate job should suffice. if that is not possible then add all of the info for both programs in the environment variables prior to calling the 1st program. (putting all the ENVVARs together prior to calling those programs would be my preference...)
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Classpath issue

      Thanks Tom.

      These are interactive jobs, so option 1 is out. Option 2 is what we are leaning towards, but it just seems like there should be a way to end/empty/remove the JVM and start over. Wonder why there isn't.

      With combining classpaths, how would you handle this situation. Here are the two programs and the commands they issue before using Java:

      Program 1
      CHGCURDIR DIR('/twewebservicesclientproduction')
      ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk50/64bit')
      ADDENVVAR ENVVAR(PATH) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk50/64bit/bin')
      ADDENVVAR ENVVAR(CLASSPATH) VALUE('./lib/soapclient.jar:./properties:./lib')

      Program 2
      ADDENVVAR ENVVAR(CLASSPATH)
      VALUE('/java/poi3.7/poi-3.7-20101029.jar
      :/java/poi3.7/poi-ooxml-3.7-20101029.jar
      :/java/poi3.7/poi-ooxml-schemas-3.7-20101029.jar
      :/java/dom4j/dom4j-1.6.1.jar:/java/xmlbeans/xbean.jar
      :/java/xmlbeans/jsr173_1.0_api.jar')
      LEVEL(*JOB)
      REPLACE(*YES)

      John

      Comment


      • #4
        Re: Classpath issue

        looks like you would only have to change the CLASSPATH ENVVAR to include all paths used in program 1 & program 2
        Code:
        ADDENVVAR ENVVAR(CLASSPATH)
        VALUE('/java/poi3.7/poi-3.7-20101029.jar
        :/java/poi3.7/poi-ooxml-3.7-20101029.jar
        :/java/poi3.7/poi-ooxml-schemas-3.7-20101029.jar
        :/java/dom4j/dom4j-1.6.1.jar:/java/xmlbeans/xbean.jar
        :/java/xmlbeans/jsr173_1.0_api.jar:./lib/soapclient.jar:./properties:./lib')
        LEVEL(*JOB)
        REPLACE(*YES)
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment

        Working...
        X