Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 87725 invoked from network); 3 Jan 2002 22:49:34 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 3 Jan 2002 22:49:34 -0000 Received: (qmail 11006 invoked by uid 97); 3 Jan 2002 22:49:29 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 10990 invoked by uid 97); 3 Jan 2002 22:49:28 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 10979 invoked from network); 3 Jan 2002 22:49:28 -0000 Date: Thu, 03 Jan 2002 14:48:36 -0800 From: "Frank E. Weiss" Subject: Re: newbie question: javac not checking build dependencies? To: Ant Users List Message-id: <3C34DFC4.E0A9A73B@well.com> MIME-version: 1.0 X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en References: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I have a question. Why use *.java or the depends task instead of using javac? The following excerpt from the Java2 SDK 1.3.1 explains what javac does. Isn't this the correct way to do dependency checking for Java? SEARCHING FOR TYPES When compiling a source file, the compiler often needs information about a type it does not yet recognize. The compiler needs type information for every class or interface used, extended, or implemented in the source file. This includes classes and interfaces not explicitly mentioned in the source file but which provide information through inheritance. For example, when you subclass java.applet.Applet, you are also using Applet's ancestor classes: java.awt.Panel, java.awt.Container, java.awt.Component, and java.awt.Object. When the compiler needs type information, it looks for a source file or class file which defines the type. The compiler searches first in the bootstrap and extension classes, then in the user class path. The user class path is defined by setting the CLASSPATH environment variable or by using the -classpath command line option. (For details, see Setting the Class Path). If you use the -sourcepath option, the compiler searches the indicated path for source files; otherwise the compiler searches the user class path both for class files and source files. You can specify different bootstrap or extension classes with the -bootclasspath and -extdirs options; see Cross-Compilation Options below. A successful type search may produce a class file, a source file, or both. Here is how javac handles each situation: Search produces a class file but no source file: javac uses the class file. Search produces a source file but no class file: javac compiles the source file and uses the resulting class file. Search produces both a source file and a class file: javac determines whether the class file is out of date. If the class file is out of date, javac recompiles the source file and uses the updated class file. Otherwise, javac just uses the class file. By default, javac considers a class file out of date only if it is older than the source file. (The -Xdepend option specifies a slower but more reliable procedure.) Note that javac can silently compile source files not mentioned on the command line. Use the -verbose option to trace automatic compilation. -- To unsubscribe, e-mail: For additional commands, e-mail: