Archived

This topic is now archived and is closed to further replies.

clum

[java] Java dependancy checking

Recommended Posts

Hi, I don''t normally write large programs in Java, and even when I do, I usually use NetBeans, so I am unfamiliar with this topic. How do people which use javac from the command line handle file dependencies? The first thing that came to mind was a Makefile, but I noticed that GNU make (I''m using linux) doesn''t have any built-in rules for java files, so I''m not so sure. How do the few people that use command line compilation do so? The official zorx website

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There are a few things that can be done. First, most java projects use <a href=''http://ant.apache.org/''>ant</a> for their automated build process, rather than make. I don''t believe ant actually does any dependency checking, so you''d have to check that out.

Second, compiling java is so much faster than compiling C that for small and medium sized projects, you can recompile the whole project pretty fast. This doesn''t help for large projects, of course. And this argument is enhanced considerably if you use the jikes compiler.

Third, if you use Eclipse as your IDE, its built-in compiler does full dependency checking automatically.

Fourth, there is a project called javamake for creating dependency lists for java programs for make. I don''t know any details about it, though, so check google.

Share this post


Link to post
Share on other sites
"How do people which use javac from the command line handle file dependencies?"


You push everything into one directory and compile. I didn''t have too much problems with it, yet. Makexxx are generaly harmfull

Share this post


Link to post
Share on other sites
javac is a smart compiler. If it cannot find a class file for a dependency, it will compile the appropriate source file, if it is available and in the classpath. It cannot check out of date class files though.



First make it work, then make it fast. --Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte

Share this post


Link to post
Share on other sites