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
A workaround is to chunk your string using new String() (yikes) or StringBuilder, e.g.
String CONSTANT = new String("first chunk")
+ new String("second chunk") + ...
+ new String("...");
Or
String CONSTANT = new StringBuilder("first chunk")
.append("second chunk")
.append("...")
.toString();
These can be viable options if you're producing this string e.g. from a code generator. The workaround documented in this answer where string literals are concatenated no longer works with Java 11