ArrayIndexOutOfBoundsException means that you're trying to access an array using an invalid index. If the length of the array is N, then 0 upto and including N - 1 are valid indices.
Read the error message carefully. It tells you exactly in which line the error occurs. Carefully analyze your program to see what happens. Add some System.out.println(...) statements to print out useful information, to help you understand what's happening. You could also run the code using a debugger, so that you can step through the code line by line while it runs, which might help you understand what happens exactly.
One more point... The partition(...) method should be used internally by method that actually implements the algorithm (if you really want Quicksort) and not invoked separately from main. So I would make that one private and change the implementation accordingly.
The quieter you are, the more you are able to hear.
you can always stick in System.out.println() statements to see what your code is doing. Whichever line is throwing the error, print out what index you are trying to reference. You will probably see you are trying to access index n on an array that has n elements. Since you can only use indexes 0 through n - 1, using n give an out of bounds exception.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors