Skip to main content

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?

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?

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.