javac exits with error "constant string too long"
Last updated on NOVEMBER 05, 2016
Applies to:Java SE JDK and JRE - Version 5.0 to 8
Information in this document applies to any platform.
The Java language compiler 'javac' fails to compile Java source code
and exits with error message "constant string too long". Example:
BigString.java:2: constant string too long
You have created new source code or changed existing source code. Example:
String myConst = ""+
"... /* the length of this String is greater or equal than 0xFFFF chars */ ...";
For an actual example see BigString.java
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms