Highlighted
transCM Absent Member.
Absent Member.
3720 views

Build JVM COBOL by ant

Jump to solution

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]
[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!

environment
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


.cobolBuild
<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"/>
</mfdirlist>

Tags (2)
0 Likes
3 Solutions

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

RE: Build JVM COBOL by ant

Jump to solution

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.

Thanks.

0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Build JVM COBOL by ant

Jump to solution

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.

0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Build JVM COBOL by ant

Jump to solution

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.

0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

RE: Build JVM COBOL by ant

Jump to solution

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.

Thanks.

0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Build JVM COBOL by ant

Jump to solution

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.

0 Likes
transCM Absent Member.
Absent Member.

RE: Build JVM COBOL by ant

Jump to solution

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.

0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Build JVM COBOL by ant

Jump to solution

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.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.