Build JVM COBOL by ant

Build JVM COBOL by ant

I had a problem when I build a JVM COBOL(JUnit test) by ant(ant -lib $COBDIR/lib/mfant.jar -f .cobolBuild).
[cobol] Compiling SUSJ2401_test.cbl...
[cobol] ** COBCH1561S JVM support not found: Possibly the type info helper classes were not on the classpath : /home/admin/workspace/Test_RXSub/src/junit/SUSJ2401_test.cbl(0,1,0)
[cobol] cob32: error(s) in compilation: /home/admin/workspace/Test_RXSub/src/junit/SUSJ2401_test.cbl
[cobol] Compilation complete with 1 errors, 0 warnings, 0 notices and an exit code of 16
I set the CLASSPATH up in the environment(RHEL6.1) and the script(.cobolBuild). But the build still failed.
Have I missed anything?

Thank you!

export CLASSPATH=.:/usr/java/jdk1.6.0_29/jre/lib/resources.jar:/usr/java/jdk1.6.0_29/jre/lib/rt.jar:/usr/java/jdk1.6.0_29/jre/lib/jsse.jar:/usr/java/jdk1.6.0_29/jre/lib/jce.jar:/usr/java/jdk1.6.0_29/jre/lib/charsets.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/dnsns.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/localedata.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/sunjce_provider.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/sunpkcs11.jar:/opt/microfocus/VisualCOBOL/lib/mfcobol.jar:/opt/microfocus/VisualCOBOL/lib/mfcobolrts.jar:/opt/microfocus/VisualCOBOL/lib/mfsqljvm.jar:/opt/microfocus/VisualCOBOL/eclipse/eclipse/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar:/home/admin/lib/org.hamcrest.core_1.1.0.v20090501071000.jar:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH

<mfdirlist id="cobol_directive_set_1">
<directive name="DIALECT" value="MF"/>
<directive name="COPYEXT" value="cpy,cbl"/>
<directive name="NOWARNING"/>
<directive name="ILUSING" value="java.lang"/>
<directive name="CHARSET" value="ASCII"/>
<directive name="SOURCEFORMAT" value="variable"/>
<directive name="MAX-ERROR" value="100"/>
<directive name="SOURCETABSTOP" value="4"/>
<directive name="JVMCLASSPATH" value="/usr/java/jdk1.6.0_29/jre/lib/resources.jar:/usr/java/jdk1.6.0_29/jre/lib/rt.jar:/usr/java/jdk1.6.0_29/jre/lib/jsse.jar:/usr/java/jdk1.6.0_29/jre/lib/jce.jar:/usr/java/jdk1.6.0_29/jre/lib/charsets.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/dnsns.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/localedata.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/sunjce_provider.jar:/usr/java/jdk1.6.0_29/jre/lib/ext/sunpkcs11.jar:/opt/microfocus/VisualCOBOL/lib/mfcobol.jar:/opt/microfocus/VisualCOBOL/lib/mfcobolrts.jar:/opt/microfocus/VisualCOBOL/lib/mfsqljvm.jar:/opt/microfocus/VisualCOBOL/eclipse/eclipse/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar:/home/admin/lib/org.hamcrest.core_1.1.0.v20090501071000.jar"/>

  • Verified Answer

    What you are receiving is a checker error (COBCH1561S) saying the JVM support is not found so we would like you to try a test to ensure that your environment is setup properly.

    Could you please try compiling a very simple Hello World type COBOL program using the cob32 –j command?

    Does this give you the same error?

    Does this cob32 command work with your more complex class?

    Which product version are you using, 2.1 or 2.1 Update 1 which was just recently released?

    Are you running the cobsetenv script to set up the COBOL environment prior to running your build?

    We just tried creating a simple JVM class (and one derived from junit) and have no problem when building this from the command line using Ant.

    For specific problems like you are experiencing it is probably best to contact Customer Care directly instead of going through the Community Site as the Community Site is not meant to be a replacement for true Customer product issues like the ones that you are having.


  • Verified Answer

    You may try runniing . $COBDIR/bin/cobsetenv as a . call to populate COBOL and JAVA with COBOL support into the enviornment prior to running the ant script.

  • Thank you for reply.

    After I running $COBDIR/bin/cobsetenv.The error has gone.

    But after I reboot  the host , the same error has come again.Have I run $COBDIR/bin/cobsetenv after the host reboot?

    Thank you.

  • Verified Answer

    Yes since runnning that script only changes the envioronment for that shell and child shells.  However, you can run cobsetenv in script prior to invoking ant as one script or run it as part of the user's .profile at logon.