Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Package naming, disk organization Date: Thu, 4 Jul 2013 20:40:59 +0000 (UTC) Organization: A noiseless patient Spider Lines: 66 Message-ID: References: <51D5A431.4060001@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 4 Jul 2013 20:40:59 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="19769"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T8IZBDb8b1hsJcNYhmTkP3rasCy2NsoQ=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:1dnfqbQDev3ESVlT41SdSTkzve8= Xref: csiph.com comp.lang.java.programmer:24628 On Thu, 04 Jul 2013 12:34:57 -0400, Dave wrote: > On 07/03/2013 11:35 PM, markspace wrote: >> I still don't like the split between src and class at the top level. >> It's weird, and as others have pointed out you'll fight most tools >> (IDEs, etc.) to do it this way. Easier is project_name/src and >> project_name/build/classes. >> Same here - and I've never bothered with any attempt to separate .java files from the rest of the compiler output. All the tools (javac, ant, javadocs etc.) can work very nicely with this mix. I know some C programmers like to separate source from object, but in Java its really just as easy to leave them in the same place. ant, in particular, is even has a notation, "org/**/*.class", which means "walk the directory tree whose root is 'org' and apply this operation to every class file in the tree. IOW, if it was building a jarfile, it would include all the directories and class files while omitting any other files in the tree. >> Getting a domain name is the absolute least of your concerns. >> Indeed, though there is an Internet convention that .co.uk and .com should be used if you intend to sell stuff from your domain but that non- profit organisations are better placed in .org.uk or .org > I should also point out that I'm a tad old fashion (I guess) because I > use an editor and command line. I do plan to go to an IDE - once I'm > told which one everyone wants to use. > I should add that I don't usually use an IDE: I find that my needs are nicely met by a decent multi-buffering text editor and ant (the Javan equivalent of make). > Ok, back to the subject. I want to obey the conventions, but not box > myself in or create future problems. So how about: > * domain (used for general Java development for now): dboland * source: > home/user/javadev/dboland/proj_name/src * classes: > home/user/javadev/dboland/proj_name/classes > // I don't get the need for build/classes. > * CLASSPATH: home/user/javadev/dboland > I maintain a separate directory where I place jar files, /home/java/jarlib and put that in the CLASSPATH During development I don't bother with project jar files, but run everything from the project directory: My login directory: /home/user My project directory: /home/user/project Typical package name: org.gregorie.project .java, .class files etc: /home/user/project/org/gregorie/project/*.class so, if I'm in ~/project, running 'ant' will compile any changed classes and then running "java org/gregorie/project/MainClass" will run the newly compiled stuff. Similarly, ant can run 'jar' and build a correct jarfile in ~/project using a manifest that would also be in ~/project. Last, nut not least, ~/project is the base module directory for CVS (or any other version control system. > Comments? > HTH -- martin@ | Martin Gregorie gregorie. | Essex, UK org |