Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
gulshan Absent Member.
Absent Member.
917 views

C$JAVA-INVALID OPCODE “CALLJAVAMAIN”

Jump to solution

I am trying to call a JavaUI program ”JavaSwingUI.Java” from Acucobol program on click of a button which will load the UI screen. I have the following in my event paragraph :

CALL "C$JAVA" USING CJAVA-CALLJAVAMAIN, "JavaSwingUI"  GIVING STATUS-VAL.

Java code:

     public static void main(String[] args){

     JavaSwingUI swingUI = new JavaSwingUI(); 

     swingUI.prepareGUI();

     }

Initially CALLJAVAMAIN was missing in java.def file, so I added it with opcode 29. Now, when I execute cobol program which is going to call main function of the java program it errors out with -8 ‘Invalid Opcode’

I am using Acucobol720. Do I need to place most recent java.def file? or Is there a different way to call main method of Java program?

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

RE: C$JAVA-INVALID OPCODE “CALLJAVAMAIN”

Jump to solution

Adding the opcode into the def file does not mean that the function is actually present in the runtime. Support for CALLJAVAMAIN was added into Version 8. It is not present in Version 7, or 7.2.

View solution in original post

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

RE: C$JAVA-INVALID OPCODE “CALLJAVAMAIN”

Jump to solution

Adding the opcode into the def file does not mean that the function is actually present in the runtime. Support for CALLJAVAMAIN was added into Version 8. It is not present in Version 7, or 7.2.

View solution in original post

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.