java.lang.StringIndexOutOfBoundsException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

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.


rafaelrafael

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

  • FULL PRODUCT VERSION : ADDITIONAL OS VERSION INFORMATION : OS X El Capitan ver. 10.11.2 (15C50) A DESCRIPTION OF THE PROBLEM : I cannot run basic java code on Sublime 3 Text STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Download Sublime 3 for Mac run the following code on a Java format: class HelloWorld { public static void main(String[] args) { System.out.println("HelloWorld") } } EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - An exception has occurred in the compiler (1.6.0_65). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. 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] [shell_cmd: javac ""] [dir: /Volumes/Sublime Text/Sublime Text.app/Contents/MacOS] [path: /usr/bin:/bin:/usr/sbin:/sbin] ACTUAL - An exception has occurred in the compiler (1.6.0_65). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. 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] [shell_cmd: javac ""] [dir: /Volumes/Sublime Text/Sublime Text.app/Contents/MacOS] [path: /usr/bin:/bin:/usr/sbin:/sbin] REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- class HelloWorld { public static void main(String[] args) { System.out.println("HelloWorld") } } ---------- END SOURCE ----------
    via by Webbug Group,
  • exception occured in java compiler
    via Stack Overflow by Ak17
    ,
    • 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]

    Users with the same issue

    linxiaolonglinxiaolong
    1 times, last one,
    HronomHronom
    32257 times, last one,
    balintnbalintn
    4 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    30 more bugmates