java.lang.StringIndexOutOfBoundsException

String index out of range: 0


Samebug tips1

Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.


Solutions on the web6201

Solution icon of coderanch
via Coderanch by Juan Bonilla, 10 months ago
String index out of range: 0

Solution icon of coderanch
via Coderanch by duhit Choudhary, 1 year ago
String index out of range: 0

Solution icon of coderanch
via Coderanch by Don Nguyen, 10 months ago
String index out of range: 0

Solution icon of coderanch
via Coderanch by chaitanya kiran pvn, 8 months ago
String index out of range: 0

Solution icon of icesoft
via Icesoft by makoto1337, 1 year ago
String index out of range: 0

Solution icon of bugzilla
via Eclipse Bugzilla by sven.efftinge, 1 year ago
String index out of range: 0

Solution icon of bugzilla
via Eclipse Bugzilla by neale, 1 year ago
String index out of range: 0

Solution icon of bugzilla
via Eclipse Bugzilla by yevshif, 1 year ago
String index out of range: 0

Solution icon of bugzilla
String index out of range: 0

Solution icon of bugzilla
via Apache Bugzilla by new_connie, 1 month ago
String index out of range: 0

Stack trace

  • java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:686) at com.sun.tools.javac.main.Main.processArgs(Main.java:180) at com.sun.tools.javac.main.Main.compile(Main.java:309) at com.sun.tools.javac.main.Main.compile(Main.java:279) at com.sun.tools.javac.main.Main.compile(Main.java:270) at com.sun.tools.javac.Main.compile(Main.java:69) at com.sun.tools.javac.Main.main(Main.java:54)[Finished in 0.3s with exit code 4]

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 6 months ago
32257 times, 7 months ago
4 times, 11 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
35 more bugmates