Java "constant string too long" compile error. Only happens using Ant, not when using Eclipse
Posted
by Allan
on Stack Overflow
See other posts from Stack Overflow
or by Allan
Published on 2010-04-29T15:26:10Z
Indexed on
2010/04/29
15:37 UTC
Read the original article
Hit count: 514
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 fine.
Recently, I decided to create an ant build file to use. Whenever I compile the same class with ant, I get the "constant string too long" compile error. I've tried a number of ways to set the java compiler executable in ant to make sure that I'm using the exact same version as in Eclipse.
I'd rather figure out how to get the same successful compile I get in Eclipse in Ant than try to rework the code to dynamically concatenate the strings.
© Stack Overflow or respective owner