[java] Java dependancy checking

Started by
4 comments, last by clum 20 years, 3 months ago
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
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
Advertisement
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.
"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
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
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
In other words, I either recompile everything everytime, pay attention when I change things, or create my own Makefile?

The official zorx website
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
Use Ant, as the AP said.

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement