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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips


Thrown by the methods of the String class to indicate that an index is either negative, or greater than the size of the string itself. You are probably using the wrong index when accessing substring of the array.

via GitHub by Omertron

You need to make sure that capitalisation of the case for the plugin in the properties file is exactly: "AllocinePlugin" and not "allocineplugin"

Solutions on the web

via GitHub by lundefugl
, 1 year ago
via Oracle Community by 843841, 1 year ago
String index out of range: -2
via by Unknown author, 1 year ago
via Stack Overflow by C-3ow
, 1 year ago
via Eclipse Bugzilla by daniel_megert, 1 year ago
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
at java.lang.String.substring(
at oshi.util.ParseUtil.hexStringToString(
at undefined.SystemInfoTest.main(

Users with the same issue

8 times, 1 week ago
2 times, 2 weeks ago
4 times, 2 months ago
4803 times, 2 months ago
3 times, 2 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.