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

前端 未结 11 2167
抹茶落季
抹茶落季 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 15:57

    Someone is trying to send you a message :-) In the time you've spend fiddling with compiler versions you could have loaded the data from a text file - which is probably where it belongs.

    Check out:

    • java.util.Properties
    • Apache Commons FileUtils.readFileToString()

提交回复
热议问题