Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            
            int txtCsl = 1;
            int ptnCsl = 0;
            
            int[] skip = new int[pattern.length() + 2];
            
            skip[txtCsl] = 0;
            
            //????´¢????±??????????????????????+1?????§
            while (txtCsl != pattern.length() + 1) {
                //??????????????????????????????????????????
                if (txtCsl != pattern.length() && pattern.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                    skip[++txtCsl] = ++ptnCsl;
                } else if (ptnCsl == 0) {
                    skip[++txtCsl] = ptnCsl;
                } else {
                    ptnCsl = skip[ptnCsl];
                }
            }
            
            txtCsl = ptnCsl = 0;
            while (txtCsl != text.length() && ptnCsl != pattern.length()) {
                if (text.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                    txtCsl++;
                    ptnCsl++;
                    if (ptnCsl == pattern.length()) {
                    	System.out.println(txtCsl - ptnCsl - 2);
                    	ptnCsl = skip[ptnCsl];
                    }
                } else if (ptnCsl == 0) {
                    txtCsl++;
                } else {
                    ptnCsl = skip[ptnCsl];
                }
            }
        
        
        }catch(IOException e){
            System.out.println(e);
        }  
    }
}

Compiler output:
Main.java:13: error: cannot find symbol
            int[] skip = new int[pattern.length() + 2];
                                 ^
  symbol:   variable pattern
  location: class Main
Main.java:18: error: cannot find symbol
            while (txtCsl != pattern.length() + 1) {
                             ^
  symbol:   variable pattern
  location: class Main
Main.java:20: error: cannot find symbol
                if (txtCsl != pattern.length() && pattern.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                              ^
  symbol:   variable pattern
  location: class Main
Main.java:20: error: cannot find symbol
                if (txtCsl != pattern.length() && pattern.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                                                  ^
  symbol:   variable pattern
  location: class Main
Main.java:20: error: cannot find symbol
                if (txtCsl != pattern.length() && pattern.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                                                                            ^
  symbol:   variable pattern
  location: class Main
Main.java:30: error: cannot find symbol
            while (txtCsl != text.length() && ptnCsl != pattern.length()) {
                                                        ^
  symbol:   variable pattern
  location: class Main
Main.java:31: error: cannot find symbol
                if (text.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                                           ^
  symbol:   variable pattern
  location: class Main
Main.java:34: error: cannot find symbol
                    if (ptnCsl == pattern.length()) {
                                  ^
  symbol:   variable pattern
  location: class Main
8 errors