JAVA build error: code too large

Document ID : KB000008765
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

CA Gen java compile fails during the build process for the below reason. The generated java method is too large and it signals the compiler to fail. Its little difficult split the code and gen, as there many modules fails for this reason. 

 

build.ab: 

[echo] 

[echo] ...Verifying Action Block Classes 

[echo] 

[echo] ...Compiling Action Block Classes 

[javac] Z:\jvm\java\MLGSPC01.XML:450: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds 

[javac] Compiling 199 source files to Z:\jvm\java\classes\XXXXXX01 

[javac] Z:\jvm\java\m54714429\XXXXX142.java:4691: code too large 

[javac] public void f_55239209() 

[javac] ^ 

[javac] 1 error 

 

BUILD FAILED 

Z:\jvm\java\MLGSPC01.XML:450: Compile failed; see the compiler error output for details. 

 

Total time: 1 minute 51 seconds 

IEFSIGNAL:FAIL 

 

Generating code using a CSE and then installing with a Windows Build Tool.

Resolution:

 

1. At a command prompt do the following command: set COOL_GEN_MAX_WEIGHT=100 

2. Start the toolset from the same command prompt: "%GEN85%GEN\toolset.bat" 

3. Generate just the affected action block, the action block that gets the 'code too large' error. 

4. Close the Toolset. 

5. Start the Toolset as you normally do, generate and install the rest of the action blocks and the load module. 

 

Be advised, do not generate unaffected action blocks with this option. 

 

NOTE: If the variable COOL_GEN_MAX_WEIGHT is not set, the code will use a default value of 450 as a sort of "limit" to determine if the code needs to be split up into smaller chunks to get by the compiler error. So setting the variable higher than that wouldn't help. 

Since the default value of 450 may cause the error, a value will need to be tried lower than 450 and then use the "highest" lowered value possible. Nothing has been seen to correlate the number of action diagram statements to what the actual value should be. It is matter of trial and error.