Path: csiph.com!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Steven Simpson Newsgroups: comp.lang.java.help Subject: Re: IDE suggestion Date: Sun, 24 Feb 2013 21:31:14 +0000 Organization: A noiseless patient Spider Lines: 93 Message-ID: <2edqv9-7rc.ln1@s.simpson148.btinternet.com> References: <16cce9e6-429a-424a-963b-69a629768a47@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx05.eternal-september.org; posting-host="009ec2585e5ddb9ccd183f63355dd78f"; logging-data="6332"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Rr5WtP5H461HRSYv21JMNNMcTm1RGsGE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 In-Reply-To: <16cce9e6-429a-424a-963b-69a629768a47@googlegroups.com> Cancel-Lock: sha1:DCAe3w3/Ewrx73twB3BEel2QE/E= Xref: csiph.com comp.lang.java.help:2544 On 24/02/13 20:23, Lew wrote: > Lightest weight is a text editor plus Ant plus command line, which works > just fine. I came to the conclusion that Ant is insufficient without an error-detecting editor (as in an IDE). If class Foo uses class Bar, class Bar could be changed in a way that causes an error in Foo, yet Ant will not detect that Foo needs to be recompiled in order to see the error, which goes unnoticed until runtime, or until Foo is re-compiled. Is my conclusion incorrect? Am I using Ant correctly?: % cat build.xml % cat src/Foo.java public class Foo { public static void main(String[] args) throws Exception { new Bar(); } } % cat src/Bar.java public class Bar { } % ant clean Buildfile: /scratch/simpsons/Scratch/Coding/antfail2/build.xml clean: [delete] Deleting directory /scratch/simpsons/Scratch/Coding/antfail2/classes BUILD SUCCESSFUL Total time: 0 seconds % ant Buildfile: /scratch/simpsons/Scratch/Coding/antfail2/build.xml compile: [mkdir] Created dir: /scratch/simpsons/Scratch/Coding/antfail2/classes [javac] Compiling 2 source files to /scratch/simpsons/Scratch/Coding/antfail2/classes [javac] /scratch/simpsons/Scratch/Coding/antfail2/src/Bar.java [javac] /scratch/simpsons/Scratch/Coding/antfail2/src/Foo.java BUILD SUCCESSFUL Total time: 0 seconds % java -cp classes Foo % sed -e 's/class/abstract class/' -i src/Bar.java % cat src/Bar.java public abstract class Bar { } % ant Buildfile: /scratch/simpsons/Scratch/Coding/antfail2/build.xml compile: [javac] Compiling 1 source file to /scratch/simpsons/Scratch/Coding/antfail2/classes [javac] /scratch/simpsons/Scratch/Coding/antfail2/src/Bar.java BUILD SUCCESSFUL Total time: 0 seconds % java -cp classes Foo Exception in thread "main" java.lang.InstantiationError: Bar at Foo.main(Unknown Source) % touch src/Foo.java % ant Buildfile: /scratch/simpsons/Scratch/Coding/antfail2/build.xml compile: [javac] Compiling 1 source file to /scratch/simpsons/Scratch/Coding/antfail2/classes [javac] /scratch/simpsons/Scratch/Coding/antfail2/src/Foo.java [javac] /scratch/simpsons/Scratch/Coding/antfail2/src/Foo.java:3: error: Bar is abstract; cannot be instantiated [javac] new Bar(); [javac] ^ [javac] 1 error BUILD FAILED /scratch/simpsons/Scratch/Coding/antfail2/build.xml:6: Compile failed; see the compiler error output for details. Total time: 0 seconds -- ss at comp dot lancs dot ac dot uk