Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Is it necessary the source file should be at the same location with the class file? Date: Sun, 24 Jul 2016 21:28:23 -0000 (UTC) Organization: A noiseless patient Spider Lines: 40 Message-ID: References: <8bnf6d-sua.ln1@s.simpson148.btinternet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 24 Jul 2016 21:28:23 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="3277"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19e1nZzT0GOeKPmOBAdkyQr60dWFlEGDfM=" User-Agent: Pan/0.140 (Chocolate Salty Balls; GIT 3663720 git://git.gnome.org/pan2) Cancel-Lock: sha1:uOjTHrkExIjzV1RuhGQd0oV2H9I= Xref: csiph.com comp.lang.java.programmer:35131 On Sun, 24 Jul 2016 22:08:24 +0100, Steven Simpson wrote: > On 24/07/16 12:47, Arne Vajhøj wrote: >> On 7/24/2016 3:42 AM, Steven Simpson wrote: >>> On 24/07/16 00:05, Arne Vajhøj wrote: >>>> projectroot/mypackage/MyClass.class >>>> >>>> Remember to have projectroot in classpath. >>> >>>> projectroot/bin/mypackage/MyClass.class >>>> >>>> Remember to have projectroot/bin in classpath. >>> >>> Do you mean just for executing, or for compiling (too)? >> >> For: >> * excecuting * compiling if multiple compiles > > With the output directory in the classpath, doesn't it mean that javac > will attempt a kind of incremental build? And doesn't it then miss some > not particularly extraordinary cases (inlined constants; return types), > leading to broken builds? ISTR it being discussed here not so long ago, > but haven't found the thread. The following assumes you're using ant to control compiles, etc. I've seen that problem in the past, but not recently. However, it never hurts to add a 'clean' , that removes all *.class and *.jar files that a build generates, to your build.xml and running "ant clean; ant" periodically. If you follow the 'large project' advice and separate *.class files from the source files, then using 'ant' or an equivalent program to manage compilation will make using the separation rather easier. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |