`
huobengle
  • 浏览: 861131 次
文章分类
社区版块
存档分类
最新评论

Java Compile Error: The code of method is exceeding the 65535 bytes limit

 
阅读更多

Issue:

When you compile your java class, you may got following error.

The code of method is exceeding the 65535 bytes limit

Reason:

According Java specification, one Java method size must be less than 65535 Bytes (64k). In most cases you encounter this error is because you want to init a big data or your java class is generated by some toolkit.

Solution:

One workaround is divide your big size method into some pieces of small size methods.

For example,

public static Float[][] getSMatrix()
{
    initSMatrixPart1() ;
    initSMatrixPart2() ;
    initSMatrixPart3() ;
    initSMatrixPart4() ;
    initSMatrixPart5() ;
        
    return sMatrix;
        
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics