After looking for hours I still can't figure out where the Null-pointer-Exception is originating. This code is supposed to compare the words from two .txt-files containing words (1 per line). The words from the "readlist.txt"-file are to be unscrambled before comparison. If a match is found the unscrambled word is appended to the output String. The problematic line is: "scrambled_words[scrambled_iterator] = scrambled_line_yup;"
Thanks for helping me in advance.
//Try any "char-combination"-method
public static void iterate(char[] chars, int len, char[] build, int pos, String wordlist_line_yup, String ausgabe) {
    if (pos == len) {
        String word = new String(build);
        if ( word.equals(wordlist_line_yup)) {
            output += word+",";
        }
        return;
    }
    for (int i = 0; i < chars.length; i++) {
        build[pos] = chars[i];
        iterate(chars, len, build, pos + 1,wordlist_line_yup, ausgabe);
    }
}
//main method
public static void main (String[] args)throws IOException {
    //Initialisiere Ausgabe String
    String output = "";
    //File Initialisation
    File path1 = new File ("c:/users/xxx/Desktop/wordlist.txt");
    File path2 = new File ("c:/users/xxx/Desktop/readlist.txt");
    System.out.print(path1.exists()? "exists" : "doesnt exist");
    System.out.print(path2.exists()? "exists" : "doesnt exist");
    //Read the readList with scrambled words and put lines into string-array
    BufferedReader scrambledreader = new BufferedReader(new FileReader("c:/users/xxx/Desktop/readlist.txt"));
    String[] scrambled_words = {};      
    int scrambled_iterator = 0;
    String scrambled_line;
    while ((scrambled_line = scrambledreader.readLine()) != null) {
        String scrambled_line_yup = "";
        scrambled_line_yup += scrambled_line;
        scrambled_line_yup.trim();
        if(! "".equals(scrambled_line_yup)){
            scrambled_words[scrambled_iterator] = scrambled_line_yup;
            scrambled_iterator++;
        }
    }
    scrambledreader.close();
    //Read the wordList and compare to array with scrambled words
    BufferedReader wordlistreader = new BufferedReader(new FileReader("c:/users/xxx/Desktop/wordlist.txt"));
    String wordlist_line;
    while ((wordlist_line = wordlistreader.readLine()) != null) {
        String wordlist_line_yup = "";
        wordlist_line_yup += wordlist_line;
        wordlist_line_yup.trim();
        if(! "".equals(wordlist_line_yup)){
            for (String x : scrambled_words) {
                    if(! "".equals(x)){
                        char[] chars = x.toCharArray();
                        int len = chars.length;
                        iterate(chars, len, new char[len], 0, wordlist_line_yup, ausgabe);
                    }
            }
        }
    }
    wordlistreader.close();
    //Output in Cmd
    System.out.println(output);     
}
}
