4.10. Building Your Code
Problem
You want to create
compiled
.class files.
Solution
By default, compiled .class files are created or
updated when you save your code. You also can perform builds
manually.
Discussion
When you save a resource, .class files are built
automatically by default. If that feature isn’t
turned on, select Window→ Preferences→ Workbench,
and then check the “Perform build automatically on
resource modification” checkbox, as shown in Figure 4-15. To turn off automatic building, uncheck this
checkbox.

Figure 4-15. Turning on auto-build
To build a project manually, select Project→ Build Project.
Tip
If a .class file has been moved or damaged,
auto-build won’t work, and you’ll
have to start over by rebuilding the .class file
yourself. In this case, select Project→ Build Project.
Changing the build order
Eclipse actually does a good job setting the build order of projects by interpreting project references itself. However, you also can set the build order yourself. Select Window→ Preferences→ Build Order, as shown in Figure 4-16.

Figure 4-16. Setting the build order
Building only selected projects
If you highlight a project in a view and select Project→ Rebuild Project, the project you’ve selected is rebuilt. What’s cool about this is that you can choose only certain projects and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access