Building Java source code

posted in: Uncategorized | 0

Compiling source code has gone a long way since passing in a list of filenames for C/C++ compiler. For compiling Java source code, many alternatives for compiling .java source code files into .jar archives exist. I have been using three approaches: Eclipse IDE, Ant, and Maven. Ant and Maven are friendly to the command line and fully controllable in build files. This requires the programmer to explicitly “run” a build command. Eclipse IDE, on the other hand, hides the command line interface by compiling source code as it changes. This works well for native Java projects, but it becomes flaky for Android projects. Sometimes, some files don’t get re-compiled automatically or file dependencies prevent a successful automatic compilation. In such a circumstance cleaning the project to trigger a full rebuild fixes compilation errors.