Compiling Your First Java Application

We’re now ready to compile and execute our program. We assume you’re using the Java Development Kit’s command-line tools, not an IDE. To help you compile and run your programs in an IDE, we provide online Dive Into® videos for the popular IDEs Eclipse, NetBeans and IntelliJ IDEA. These are located on the book’s website:

To prepare to compile the program, open a command window and change to the directory where the program is stored. Many operating systems use the command cd to change directories. On Windows, for example,

cd c:\examples\ch02\fig02_01

changes to the fig02_01 directory. On UNIX/Linux/Max OS X, the command

Get Java™ How To Program (Early Objects), Tenth Edition 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.