Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #2544
| From | Steven Simpson <ss@domain.invalid> |
|---|---|
| Newsgroups | comp.lang.java.help |
| Subject | Re: IDE suggestion |
| Date | 2013-02-24 21:31 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <2edqv9-7rc.ln1@s.simpson148.btinternet.com> (permalink) |
| References | <kgcs9j$epe$1@dont-email.me> <nospam-BAA3EA.15005124022013@news.aioe.org> <16cce9e6-429a-424a-963b-69a629768a47@googlegroups.com> |
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
<project default="compile">
<target name="compile">
<mkdir dir="classes" />
<javac srcdir="src" destdir="classes"
listfiles="yes" includeDestClasses="true"
includeAntRuntime="false" />
</target>
<target name="clean">
<delete dir="classes" />
</target>
</project>
% 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
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
IDE suggestion "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-24 11:08 +0000
Re: IDE suggestion "John B. Matthews" <nospam@nospam.invalid> - 2013-02-24 15:00 -0500
Re: IDE suggestion Lew <lewbloch@gmail.com> - 2013-02-24 12:23 -0800
Re: IDE suggestion "Schizoid Man" <schiz_man@21stcentury.com> - 2013-02-24 20:40 +0000
Re: IDE suggestion Lew <lewbloch@gmail.com> - 2013-02-24 14:51 -0800
Re: IDE suggestion Roedy Green <see_website@mindprod.com.invalid> - 2013-02-25 11:27 -0800
Re: IDE suggestion Steven Simpson <ss@domain.invalid> - 2013-02-24 21:31 +0000
Re: IDE suggestion Roedy Green <see_website@mindprod.com.invalid> - 2013-03-01 00:18 -0800
Re: IDE suggestion Steven Simpson <ss@domain.invalid> - 2013-03-01 12:30 +0000
Re: IDE suggestion Roedy Green <see_website@mindprod.com.invalid> - 2013-03-09 17:35 -0800
Re: IDE suggestion Steven Simpson <ss@domain.invalid> - 2013-03-10 09:09 +0000
csiph-web