Re: Q: Java source and directory structure - 'standard way' ?

From: Karl von Laudermann (doodpants_at_mailinator.com)
Date: 01/28/04


Date: 28 Jan 2004 07:09:48 -0800

joeking@merseymail.com (FISH) wrote in message news:<dbc5020.0401280355.2f3d8cef@posting.google.com>...

>
> The point I was originally asking about was whether the source code
> directory structure *must* match exactly the package 'hierarchy' -
> and the class files should be built into the same directories as the
> source files they came from.

Yes to the first question, and no to the second.
 
> What you are saying, as I understand
> it, is that the two things should be separate, and it is a matter of
> taste (or practicality) as to whether the source layout should match
> the package hierarchy.

As I understand it, the source files must (or should) be stored in a
directory structure that matches the package hierarchy, but that
doesn't mean that the class files go into the same directories along
with the source code. Rather, they go into an identically structured
directory tree that can be located anywhere you want. I generally have
a directory called "source" which contains the source code tree, and a
directory called "build" which contains the class file tree, and the
"source" and "build" directories live next to each other. I believe
that this is the "standard" way of doing things, if there is one.

At least, this is the way JBuilder (which I use at work) manages
projects by default, and the way that the example build file for Ant
(which I use at home) does things as well.



Relevant Pages

  • Re: encrypted source file support in jdk?
    ... if anything is to be exported to different formats the format must support encryption. ... With all the new memorystick similar devices entering widespread use, and employees indiscriminately copying it to them, documents and source code is floating all over the place unprotected. ... But I think I have found a viable solution to encrypting java source/class files in jdk6, which is to use the javax.compiler tool for source code and a cloassloader for the class files. ... For jdk7 its open source so I suppose I can just patch the compiler/jvm to give it native support instead, which makes it faster and more secure. ...
    (comp.lang.java.help)
  • Re: What do I replace Arachnophilia with ?
    ... If you're looking to get source code from class files, ... > much better job than javap. ... this isn't the same as Paul making ...
    (alt.os.linux)
  • Re: Identity of bytecode
    ... source code always produce the same byte code? ... The class files themselves may be different, ... It is also possible that different versions of the Java compiler will ... produce slightly different byte-code for the same source, ...
    (comp.lang.java.programmer)
  • Re: INFORMATION
    ... > To the end users I like give them a little warranty on the producto, ... > source code the end user will lose the warranty, ... into the costumers system an comparing MD5 digest of the .class files ... he is using with your original files. ...
    (freebsd-questions)