Recipe 4.10 Building Your Code

     

4.10.1 Problem

You want to create compiled .class files.

4.10.2 Solution

By default, compiled .class files are created or updated when you save your code. You also can perform builds manually.

4.10.3 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
figs/ecb_0415.gif

To build a project manually, select Project Build Project.

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.


4.10.3.1 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
figs/ecb_0416.gif

4.10.3.2 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 just select Project Rebuild Project to rebuild them, without having to rebuild all projects (which Project Rebuild All does).



Eclipse Cookbook
Inside XML (Inside (New Riders))
ISBN: 596007108
EAN: 2147483647
Year: 2006
Pages: 232
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net