Woof! Where to start? Why pass an array to compare two integers? Why the double loop? What you want to do is be able to state clearly in English how you would solve the problem. If you can get your thinking clear, you will have an easier time putting it into code.
That said, look at:
max means largest, but the comment says smallest. Of course, Java doesn't care, because you can name your variables anything you want. However, it shows some confusion on your part, which in this case has resulted in wrong code.