javac error “code too large”?

后端 未结 3 1599
情深已故
情深已故 2021-01-01 15:39

I have a unit test where I have statically defined a quite large byte array (over 8000 bytes) as the byte data of a file I don\'t want to read every time I run my unit test.

3条回答
  •  一生所求
    2021-01-01 15:54

    Methods in Java are restricted to 64k in the byte code. Static initializations are done in a single method (see link)
    You may try to load the array data from a file.

提交回复
热议问题