Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some good java make utilities?

Tags:

java

makefile

ant

I'm looking for a make utility for building large java programs. I'm aware of ANT already, but want to see what else is available.

Ideally, it should be able to handle the .java->.class package directory weirdness that fouls up GNU Make.

Win32, but cross platform is a plus.

EDIT: I see some cons to using ANT, which is why I wanted to see other options, though I'll probably end up using it anyway, just because it works.

  • requires nontrivial XML makefiles, "HelloWorld" is already 25 lines, and any more reasonable program gets large quickly.
    • The ant tutorials show comparisons of ant build.xml files that are roughly identical to big .bat files that just run all the java commands, only longer. http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html, I've already got one of those.
    • Xml means that every single dependency, variable, target, rule and project has extra cruft on it, it just makes lines hard to read. The Angle Bracket Tax
  • solves all the wrong problems for me.
    • ant makes writing jar and javac command lines easier, generating manifests easier, specifying .java source files easier, specifying jvm/java properties easier, writing custom build tools easier.
    • ant does not make java class dependencies easier, and does not seem to have a more powerful variable system, both things usually solved by make utilities.

I'd use gnu make, but it can't figure out where the .class file for a .java file with a package declaration is going to end up.

like image 711
davenpcj Avatar asked Oct 03 '08 23:10

davenpcj


People also ask

What are utilities in Java?

util Package. It contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).

How do you create a utility in Java?

The methods in the utility class should be declared static and not abstract as object methods need instantiation. The final keyword prevents subclassing. Here, we create our own Utility class with a private constructor, which, when invoked, throws an exception.

What are utility classes?

Utilities are simple HTML classes typically scoped to a single CSS property, like border-style or background-color . Utilities can be used additively to style an object from scratch or to override a style defined in component CSS.


3 Answers

Ant and Maven are definitely the two standards. If you're already familiar with Ant and want the dependency management that comes with Maven, you might take a look at Ivy.

One thing both Ant and Maven lack is true control structures in your build scripts. There are plugins you can download for Ant that provide some of this control, but (again, if you're already familiar with Ant) you may take a look at Gant which is a Groovy wrapper for Ant.

like image 113
Townsfolk Avatar answered Oct 14 '22 21:10

Townsfolk


If you're starting a new project you may want to look into maven. It's kinda hard intially, but it handles a bunch of stuff for you including dependencies.

If you already have a project which you want to make a build file for, then I don't have any recommendations apart from the aforementioned ant.

like image 39
SCdF Avatar answered Oct 14 '22 22:10

SCdF


Forget ANT!!

Apache Maven is the way to go if you ask me.

The feature i like the most is it built in in dependency management. This means you dont have to check 3rd party JARs into your source control project.

You specify your dependencies in the maven POM (Project Object Model - Its basically an XML description of your project) and maven automatically downloads, compiles against them and packages them with your app.

Other really nice features are: Release management and distribution publication - Perform releases using maven console commands. This feature will tag your code base in source control. Checkout a clean copy, build it & package it for deployment. A second command will upload it to your repository for distribution to other end users.

A large and growing repository of libraries already using maven - EVERY Apache project uses maven. LOADS more are on board also. See for yourself, here's the main repo

Ability to host your own repo. - Where you can release your own builds and also upload JARs that dont exist in other public repos (like most SUN jars)

like image 38
Declan Shanaghy Avatar answered Oct 14 '22 21:10

Declan Shanaghy