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
Another trick, if I'm determined to put a long string in the source, is to avoid the compiler detecting it as a constant expression.
String dummyVar = "";
String longString = dummyVar +
"This string is long\n" +
"really long...\n" +
"really, really LONG!!!";
This worked for a while, but if you keep going too far the next problem is a stack overflow in the compiler. This describes the same problem and, if you're still determined, how to increase your stack - the problem seems to be the sheer size of the method now. Again this wasn't a problem in Eclipse.