How to circumvent the “Method too large” error in Java Compilation?

前端 未结 4 1091
说谎
说谎 2021-01-18 20:56

I have a parser written in bigloo scheme functional language which I need to compile into a java class. The whole of the parser is written as a single function. Unfortunatel

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-18 21:34

    Is there any possible way where I can circumvent this error?

    Well, the root cause of this compiler error is that there are hard limits in the format of bytecode files. In this case, the problem is that a single method can consist of at most 65536 bytes of bytecodes. (See the JVM spec).

    The only workaround is to split the method.

提交回复
热议问题