Compiling issues with a Java program in cis5.8 environment

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Compiling issues with a Java program in cis5.8 environment

  • Creator
    Topic
  • #54371
    Ali Salehian
    Participant

      Hello, I am learning as how to use Java program in Cloverleaf. I copied the java sample program HL7TPS.java from directory: /hci/cis5.8/integrator/java_uccs/src/samples to my own side and then compile it. I got the following error:

      1. HL7TPS.java:8: cannot access com.quovadx.cloverleaf.upoc.TPS

      2. bad class file: /hci/cis5.8/integrator/clgui/lib/cljava.jar(com/quovadx/cloverleaf/upoc/TPS.class)

      class file has wrong version 50.0, should be 49.0

      Any suggestion as how can I fix these issues!

      Thanks in advance foyer help.

    Viewing 3 reply threads
    • Author
      Replies
      • #81203
        Levy Lazarre
        Participant

          Hello Ali,

          1. The first error indicates that your CLASSPATH environment variable is not set, possibly because you are trying to compile as a user other than “hci”. In order to run those samples, it’s better to be logged on as the “hci” user. So, if you are “hci” at the command line, you may want to first run setroot and setsite to properly set your environment.

            There is no need to copy the sample java files to another location. You can compile them where they are at.

          2. The second error probably indicates that there is discrepancy between the Java version used to compile the program and the Java version supported by Cloverleaf 5.8. Find out from documentation which version of Java is supported by CIS 5.8 (Java 1.6?) and use that version to compile the source files. You cannot go higher.

          I hope this helps.

        • #81204
          Ali Salehian
          Participant

            Hello Levy,

            The followings are information related to my login and the environment:

            1. login ID

            cldev % whoami

            hci

            2. Hci root and my working site (dev_as_02)

            cldev % showroot

            HCI root is /hci/cis5.8/integrator

            HCI master site is site_master

            HCI site is dev_as_02

            3. Class path

            cldev % echo $CLASSPATH

            /hci/cis5.8/integrator/dev_as_02/java_uccs:.:/hci/cis5.8/integrator/clgui/lib/cljava.jar:/hci/cis5.8/integrator/java_uccs

            4. Java version

            cldev % java -version

            java version “1.6.0”

            5. The way that I compile.

            cldev % javac  HL7TPS.java

            Errors:

            HL7TPS.java:8: cannot access com.quovadx.cloverleaf.upoc.TPS

            bad class file: /hci/cis5.8/integrator/clgui/lib/cljava.jar(com/quovadx/cloverleaf/upoc/TPS.class)

            class file has wrong version 50.0, should be 49.0

            Please remove or make sure it appears in the correct subdirectory of the classpath.

            public class HL7TPS extends TPS

                                       ^

            1 error

            The first line of HL7TPS starts with:

            import com.quovadx.cloverleaf.upoc.*;

            Thanks for your help!

            Ali

          • #81205
            Levy Lazarre
            Participant

              So your classpath is fine and your commands are correct.

              However, 49 = Java 5

                            50 = Java 6

              The cljava.jar (which contains the TPS.class) was compiled for Java 6, and it appears that you are trying to access it with Java 5.

              It would appear to your compiler (javac) is Java 1.5

              You may have two versions of Java installed, and javac is running the 1.5 version. You should check your PATH.

            • #81206
              Ali Salehian
              Participant

                Thank you Levy for your help,

                I will follow up this issue with our Cloverleaf technical contact, sharing the information you provided with him.

                Ali

            Viewing 3 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.