Moving a bot through a maze with Depth First Search
I cleaned up your code, but it appears like your code performs a depth-first search.  It's more common to use a graph to represent the different paths than a queue, but your code works, as best as I can tell.

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Iterator;

public class DFSMaze {

    public static int[][] maze = { 
            { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }, 
            { 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9 },
            { 9, 1, 0, 1, 0, 1, 1, 0, 0, 0, 5, 9 }, 
            { 9, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 9 },
            { 9, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 9 }, 
            { 9, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 9 },
            { 9, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 9 }, 
            { 9, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 9 },
            { 9, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 9 }, 
            { 9, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 9 },
            { 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9 }, 
            { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 } 
            };

    public static Deque&lt;Coordinate&gt; deadEnd = 
            new ArrayDeque&lt;Coordinate&gt;(10);
    public static Deque&lt;Coordinate&gt; deq = 
            new ArrayDeque&lt;Coordinate&gt;(10);

    public static void main(String[] args) {
        printMaze();
        dfs(2, 10);
    }

    public static boolean isDeadEnd(Coordinate coord) {
        Iterator&lt;Coordinate&gt; it = deadEnd.iterator();
        while (it.hasNext()) {
            if (it.next().equals(coord)) {
                return true;
            }
        }
        return false;
    }

    public static Coordinate setCoord(int i, int j) {
        return new Coordinate(i, j);
    }

    public static boolean checkCoord(Coordinate coord) {
        Iterator&lt;Coordinate&gt; it = deq.iterator();
        while (it.hasNext()) {
            if (it.next().equals(coord)) {
                return true;
            }
        }
        return false;
    }

    public static int dfs(int i, int j) {
        if (i == 9 &amp;&amp; j == 9) {
            maze[9][10] = 4;
            printMaze();
            System.out.println("You're Free!");
            return 0;
        }
        Coordinate coord = new Coordinate();

        if (!checkCoord(coord) &amp;&amp; !isDeadEnd(coord)) {

            if (maze[i + 1][j] == 0 || maze[i + 1][j] == 3) {
                coord = setCoord((i + 1), j);
                deq.push(coord);
                maze[i + 1][j] = 4;
                printMaze();
                return dfs(i + 1, j);
            } else if (maze[i - 1][j] == 0) {
                coord = setCoord((i - 1), j);
                deq.push(coord);
                maze[i - 1][j] = 4;
                printMaze();
                return dfs(i - 1, j);
            } else if (maze[i][j + 1] == 0) {
                coord = setCoord(i, (j + 1));
                deq.push(coord);
                maze[i][j + 1] = 4;
                printMaze();
                return dfs(i, j + 1);
            } else if (maze[i][j - 1] == 0) {
                coord = setCoord(i, (j - 1));
                deq.push(coord);
                maze[i][j - 1] = 4;
                printMaze();
                return dfs(i, j - 1);
            }
        }

        deadEnd.push(deq.pop());
        int n = deq.peek().getX();
        int m = deq.peek().getY();
        // maze[m][n] = 0;
        return dfs(n, m);
    }

    public static void printMaze() {
        String chars = " XeEbb";
        for (int i = 0; i &lt; 12; i++) {
            for (int j = 0; j &lt; 12; j++) {
                int k = maze[i][j];
                if (k &lt; 9) {
                    System.out.print(" " + chars.charAt(k));
                    if (maze[i][j] == 5) {
                        maze[i][j] = 1;
                    }
                }
            }
            System.out.println();
        }
    }

}

class Coordinate {
    private int x;
    private int y;

    public Coordinate() {
        x = 0;
        y = 0;
    }

    public Coordinate(int i, int j) {
        x = i;
        y = j;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj instanceof Coordinate) {
            Coordinate test = (Coordinate) obj;
            if (test.x == this.x &amp;&amp; test.y == this.y) {
                return true;
            }
        }
        return (this == obj);
    }

}