Yeah, if you want to compile Java programs, it can be as simple as writing the source code in a text editor, and compiling it using the "javac" command with the Terminal (assuming you've got the developer tools installed).
If you want a fancier environment, there are a number of good choices...