Hey Fred,
So in order for you to compile source code, I suggest you download a java developers kit often abbreviated as JDK. It can be found here
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.
After you have downloaded this, assuming you are on windows, you must go into Computer>System Properties>Advanced system settings>Environmental variables...> and there you must set your PATH variable to the bin folder of the JDK you have downloaded. (This is because in order to compile and run your code, you require the commands java and javac, which are not implemented into windows, therefore when you input those commands into the command prompt, the OS doesn't know where to find them unless you specify where to find them.)
Your PATH variable should look something like "C:\Program Files\Java\jdk1.7.0_40\bin" without the quotation marks. This is mine, yours might be different. Also it is a good idea to create a CLASSPATH variable with the variable value of "." again without the quotations.
Once this is done, you can write your source code on whichever application you desire, but one crucial part is to save it as a .java file.
If you wish to compile and run your programs via command prompt, then open up command prompt by searching for "cmd" in the start menu. Once in the command prompt interface you must change the directory to wherever your file is saved. For instance, say i save my file to C:\Users\Tom\Documents\JavaPrograms. By default, you will be in the C:\Users\Tom directory, in order to get to the directory listed above you will simply type the following command "cd Documents\JavaPrograms". No quotations.
When in the correct directory it is time to compile and run our code. Say we have a file called HelloWorld.java (Very original....), to compile this we write "javac HelloWorld.java". javac being the command for java compiler. If the code has no errors, then this will compile and write a new file in the same directory called HelloWorld.class, this file is in binary and you will not be able to understand it or edit it (Binary consisting of 1's and 0's.) After compiling, we would like to run our program, therefore we simply write the command "java HelloWorld" notice how we do not include the ".java" this time after HelloWorld. The output of this program is to display the
string "Hello, World!" on the console. Therefore after typing "java HelloWorld", we expect the next line to say Hello, World!.
Hope this helped, if problems persist just post it here.