java.lang.StringIndexOutOfBoundsException: String index out of range: 0

JDK Bug System | Webbug Group | 1 year ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    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 ----------

    JDK Bug System | 1 year ago | Webbug Group
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
  2. 0

    args[] parsing fails to handle excess whitespace properly

    GitHub | 4 years ago | jvilk
    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
  3. 0

    FULL PRODUCT VERSION : java version "1.8.0_73" java(TM) SE Runtime Environment (build 1.8.0_73-b02) java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft windows [6.3.9600] A DESCRIPTION OF THE PROBLEM : An exception has occurred in the compiler (1.8.0_25). Please file a bug at the J ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnosti c in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:60) at com.sun.tools.javac.main.Main.compile(Main.java:414) at com.sun.tools.javac.main.Main.compile(Main.java:381) at com.sun.tools.javac.main.Main.compile(Main.java:370) at com.sun.tools.javac.main.Main.compile(Main.java:361) at com.sun.tools.javac.Main.compile(Main.java:56) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : run web application in tomcat, upload a .java file, then compile it and create object using Class.forName(). EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - expecting an object of the uploaded file ACTUAL - An exception has occurred in the compiler (1.8.0_25). Please file a bug at the J ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnosti c in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:60) at com.sun.tools.javac.main.Main.compile(Main.java:414) at com.sun.tools.javac.main.Main.compile(Main.java:381) at com.sun.tools.javac.main.Main.compile(Main.java:370) at com.sun.tools.javac.main.Main.compile(Main.java:361) at com.sun.tools.javac.Main.compile(Main.java:56) ERROR MESSAGES/STACK TRACES THAT OCCUR : An exception has occurred in the compiler (1.8.0_25). Please file a bug at the J ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnosti c in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:60) at com.sun.tools.javac.main.Main.compile(Main.java:414) at com.sun.tools.javac.main.Main.compile(Main.java:381) at com.sun.tools.javac.main.Main.compile(Main.java:370) at com.sun.tools.javac.main.Main.compile(Main.java:361) at com.sun.tools.javac.Main.compile(Main.java:56) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- int errorCode = com.sun.tools.javac.Main.compile(new String[] { "-classpath", "bin", "-cp", ".;"+PATHCONST.TOOLS + ";" + PATHCONST.QUARTZ + ";" + PATHCONST.JUNIT + ";" + PATHCONST.SELENIUM_JAVA + ";" + PATHCONST.SELENIUM_SERVER + ";" + System.getProperty("java.class.path"), "-d", PATHCONST.TOMCAT_CLASSES_PATH, className }); Method method = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class}); method.setAccessible(true); method.invoke(ClassLoader.getSystemClassLoader(), new Object[]{new File(ClassFilePath).toURI().toURL()}); // ClassLoader cload = new URLClassLoader(new URL[] { new File(PATHCONST.TOMCAT_CLASSES_PATH).toURI().toURL() }, // Thread.currentThread().getContextClassLoader()); System.out.println("errorcode and cload : "+errorCode+" "+method+"\njars n file path"+PATHCONST.JUNIT); Class c1= Class.forName(fileN); System.out.println("class is :"+c1); return c1; ---------- END SOURCE ---------- SUPPORT : YES

    JDK Bug System | 11 months ago | Webbug Group
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  1. tyson925 1 times, last 1 month ago
  2. Torasque 1 times, last 2 months ago
  3. Hronom 32257 times, last 2 months ago
  4. filpgame 6 times, last 2 months ago
  5. harshg 2 times, last 5 months ago
9 more registered users
18 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.StringIndexOutOfBoundsException

    String index out of range: 0

    at java.lang.String.charAt()
  2. Java RT
    String.charAt
    1. java.lang.String.charAt(String.java:686)
    1 frame
  3. Java Tools
    Main.main
    1. com.sun.tools.javac.main.Main.processArgs(Main.java:180)
    2. com.sun.tools.javac.main.Main.compile(Main.java:309)
    3. com.sun.tools.javac.main.Main.compile(Main.java:279)
    4. com.sun.tools.javac.main.Main.compile(Main.java:270)
    5. com.sun.tools.javac.Main.compile(Main.java:69)
    6. com.sun.tools.javac.Main.main(Main.java:54)[Finished in 0.3s with exit code 4]
    6 frames