To write code for your own analyses you need a Development Enviroment. To help you navigate through the myriad of decisions consult the Java Programming Resources. To get a first understanding of what the Java programming language is about, please review this Java Tutorial. Specifically review Lesson: Object-Oriented Programming Concepts of the Sun Java Tutorial. You may also download The Java Tutorial.
Minimally, you need a text editor, a compiler/linker and a Java runtime environment. To get started download the a Standard Development Kit for the computing platform of your choice.
On Mac OSX: