Why is this in Swing/JFC/AWT?
I'm moving it to a more appropriate forum... Java in General: Intermediate.
And to answer your question:
Yes... and No. There is no built-in way to generate an executable file in Java. One of Java's main points is "Write Once, Run Anywhere" and it accomplishes this through compilation of source down to bytecode, and then running the bytecode on a machine specific interpreter. In more recent versions of this interpreter the bytecode is actually compiled to machine code before it is run. This is the behavior of the HotSpot JVM, the default JVM since Java 1.2.
However, there have been several schemes to produce "compiled" Java programs, and these basically fall into 3 camps:
Translaters - All these compilers do is translate the Java source code into C or C++ code and compile it. I know GNU was working on a Java compiler like this, and I think there were a few others...Packagers - All these compilers do is package your class files together with a small JVM. Visual J++ (bleh!) did it this way, and I think a few others may have, too...Others - There are other compilers that it isn't clear exactly what they do to compile Java code. These are usually targeted at large scale development, and look to be a bit out of the price range of a single developer... JOVE is an example of this. The big question is, "Why?" Why do you want to natively compile Java code? Speed? No need for a JVM? Obfuscation of code? No matter what the reason, there is always a tradeoff and you'll be sacrificing a lot of the points of using Java by natively compiling.