Java “constant string too long” compile error. Only happens using Ant, not when using Eclipse

前端 未结 11 2186
抹茶落季
抹茶落季 2020-12-01 15:25

I have a few really long strings in one class for initializing user information. When I compile in Eclipse, I don\'t get any errors or warnings, and the resulting .jar runs

11条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 16:16

    Nothing of above worked for me. I have created one text file with name test.txt and read this text file using below code

    String content = new String(Files.readAllBytes(Paths.get("test.txt")));
    

提交回复
热议问题