How do I resolve "code too large for try statement" errors?


Question:

When I compile I get errors such as the following:

C:\2008_gui\OBJECT\MAIN_MENU.java:12810: code too large for try statement
      } catch (CallOverflowException ex$0){ throw new WrapperException (ex$0); }
        ^
What do I need to do to correct this error?

Answer:

This error is due to a limit on the number of source lines the Java compiler allows in a single block. 

Compile with -sns=1000 to set the maximum at 1000 lines per COBOL paragraph. If that doesn't work then try lower values. For best performance use the highest number that works. And optimally, only use the -sns option when compiling programs that require it.


Article ID: 97
Created: September 2, 2009
Last Updated: September 2, 2009
Author: Support KB Author

Online URL: https://support.veryant.com/support/phpkb/article.php?id=97