I come from an Eclipse background, but I love Vim as a text editor. I\'m currently experimenting with Vim as a Java IDE. Currently I do this to compile:
! javac
By request I've posted my takeaway from this question as a separate answer.
Here's how I used everyone's advice.

Add this to ~/.vimrc:
autocmd Filetype java set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
map :make:copen
map :cprevious
map :cnext
F9 to compile, F10/F11 to cycle through errors.