Compiling Code

We have the complete file, ch10_01.java, and we're ready to run it. The first step is compiling it into a bytecode file, ch10_01.class. To compile ch10_01.java, you use the Java tool javac, the Java compiler (on Windows machines, this program is called javac.exe and is located in the bin subdirectory). Here's how you use javac in general (all the arguments here are optional, and I'll place them in square brackets to indicate that, which is the convention Sun itself uses in the java documentation):

javac [options] [sourcefiles] [files] 

Here are the arguments to javac:

  • options— Command-line options. See the Java documentation for the details; we won't need any command-line options here.

  • sourcefiles— One or more code files to be ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.