Highlighted
Trusted Contributor.
Trusted Contributor.
352 views

Compiler-Error when calling a cobol-program from java using a copy in linkage-section

Jump to solution

We have following problem:

- we are using the testversion of VC4.0

- we try to call a cobol program from java

- so we created a JVM-Project with two cobol files 

-> program1.cbl and copy1.cpy 

- and a Java-Project with

-> CobolCallDemoDefaultPackage.java within a java-Project.

- now we tried to call Program1 with Copy1 as parameter, but we get the following compiler-error:
"The type com.microfocus.cobol.program.Reference cannot be resolved. It is indirectly referenced from required .class files"

 

public static void main(String[] args) {
PROGRAM1 program1 = new PROGRAM1();
Copy1 copy1 = new Copy1();
copy1.setEDatum("20180101");

program1.PROGRAM1(copy1);  <- doesn't work: The type com.microfocus.cobol.program.Reference cannot be resolved. It is indirectly referenced from required .class files

System.out.println(copy1.getADatum());
}


Where is our mistake ?


Thanks for any hint !

 

 

 

 

CallCobolFromJava.PNGcopy1.PNGprogram1.PNG

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Did you add the COBOL JVM run-time files to your Java project?

Please see the docs here: and the example here:

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Did you add the COBOL JVM run-time files to your Java project?

Please see the docs here: and the example here:

View solution in original post

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Thanks !

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.