File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes project build Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "project build" Watch "project build" New topic

project build

ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
In Eclipse,

1. what's the difference between "build" and "clean build". Why doestimes a pj can be built OK using clean build but not with normal "build" ?

2. If I have a few projects (some are ejb, few are java projects). If I click "build" and can build each of them. What does that mean ? does it just mean it generates the .class file properly ? In order to really deploy the whole thing, do I still need to write separate ant script to bundle everything ? The basic question is --- By clicking "build" does not automatically create any .war ot .ear, correct ?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33132

Which IDE are you asking about? Eclipse, NetBeans, IntelliJ, etc?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
I am using eclipse
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Build: generate .class file for your .java file .

Clean : it will remove all the .class file from particular folder

CleanBuild: it will remove all the .class file and then generate .class file for your source file(.java)[i dont see this option in eclipse. but i think it is in Netbean]
ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
sounds good. but if you choose to do "build", it also creates .class files and it should automatically replace the old .class, right ? so what's the difference of first removing all .class files ?
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Build compiles only changed .java files. This could lead to problems if, for example, class A calls a method on class B, but you change the signature of that method - build then compiles only (assuming you had previously compiled boht and Now you have a broken app. (This is only one of several things that can go wrong.)

JBoss In Action
I agree. Here's the link:
subject: project build
jQuery in Action, 3rd edition