Error in my string code?

My code works fine up until the last block when it decides to just brick on me and I can’t figure out why.

import java.util.*;
public class Problem_3_Home {

    public static void main(String[] args) {
        // 4 Strings Program
        Scanner in = new Scanner(System.in);
        System.out.println("Please enter the first string");
        String str1 = in.nextLine();
        int length = str1.length();
        if (length<6)
            System.out.println("The word " +str1+ " is short and has " 
            +length+ " characters");
        else if (length>=6)
            System.out.println("The word " +str1+ " is long and has " 
            +length+ " characters");
        System.out.println("Please enter the second string");
        String str2 = in.nextLine();
        int length2 = str2.length();
        if (length2<6)
            System.out.println("The word " +str2+ " is short and has " 
            +length2+ " characters");
        else if (length2>=6)
            System.out.println("The word " +str2+ " is long and has " 
            +length2+ " characters");
        System.out.println("Please enter the third string");
        String str3 = in.nextLine();
        System.out.println("Please enter an index number");
        int index1 = in.nextInt();
        char char1 = str3.charAt(index1);
        System.out.println("The character at that index is " +char1);
        System.out.println("Please enter the fourth string");
        String fourth = in.nextLine();
        System.out.println("Please enter an index number");
        int index2 = in.nextInt();
        char char2 = fourth.charAt((index2));
        System.out.println("The character at that index is " +char2);

    }

}

Please enter the first string
    I
The word I is short and has 1 characters
Please enter the second string
    don't
The word don't is short and has 5 characters
Please enter the third string
    get what's happening
Please enter an index number
    7
The character at that index is t
Please enter the fourth string
Please enter an index number

Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Unknown Source)
at java.util.Scanner.next(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at Problem_3_Home.main(Problem_3_Home.java:30)