Java Ecosystems for Python Programmers
(Posted on behalf of Miles Thibault, a former CSC49X student now working in London, England.)
I have a problem: I’m a Python programmer. That’s not the problem. My problem is that I’m starting a Java project and I don’t really know what experienced Java developers do when they build software.
I know I want things like version control, an IDE, unit tests and logging; but I don’t know which specific tools and libraries I should be using, nor how to best utilize them.
There are myriad books on the Java programming language proper, but I’m having a tough time finding anything that says: “If you’re going to build Java software, here are some popular/pragmatic tools that most people use because they like building quality code and they don’t like wasting their own time.”
I’ve spoken to a few Java hackers and here’s what I’ve come up with so far (thanks Bill, Sean, and Greg). I’d be interested in hearing what else you use.
| Version control | Subversion (included for completeness—I already use version control) |
| IDE | Eclipse (tough one for a Textmate fanboy) |
| Debugger | built into Eclipse. |
| Build | Ant |
| Deploy | Ant |
| Unit tests | Testng |
| Logging | Log4j |
| Docs | Javadoc |
| Lint | Findbugs |
| Coverage | Clover |
| Style | Checkstyle |
| Continuos integration | Cruisecontrol |
| Monitoring | Nagios (included for completeness) |
| Postmortem debugging | does Java do core files? |
| Performance testing | Jmeter |
| Profiling | PerformaSure? |
log4j’s Chainsaw for log analysis (can slice & dice log files, use socket-based appenders, etc) – http://logging.apache.org/log4j/docs/chainsaw.html
JProfiler for profiling – http://www.ej-technologies.com/products/jprofiler/overview.html
Hi,
Looks like you’ve got a pretty comprehensive list. I know lots of experienced Java programmer who don’t use 90% of what you’ve listed.
(I myself use many of them, but there are a few that I haven’t heard of).
Here are my two cents:
version control: for eclipse, you have a choice between subversive and subclipse. I personally prefer subversive, as it has a few better features.
build, deploy: Eclipse ships with integrated support for ant.
unit test: I use junit 4. I haven’t used testng to I can’t compare them. However, Eclipse already ships with integrated support for junit by default.
Lint and style: I was under the impression that findbugs and checkstyle do the same thing. In any case, I know that both of them integrate seamlessly into Eclipse.
Profiling (actually – monitoring, tracing and profiling): Eclipse’s tptp.
Also, I suggest to install Eclipse with WTP – even if you are not developing web application – since WTP adds the much needed xml editor to Eclipse.
Strictly speaking, Log4j is not part of the development eco-system, it is in fact a library which becomes a part of the program that you’ll be developing. In any case, you might want to look at the following libraries as well:
- struts: an mvc framework for web development.
- hibernate: an o/r mapping framework.
- spring: an IoC container, and a framework that drastically eases Java development in various areas. Very useful for enterprise-like development without learning J2EE.
- apache commons gives you a plethora of useful packages. Commons Lang in particular is a time saver.
finally, there are tons of useful plugins for Eclipse. Greg, I know you are interested in code visualisations and diagrams. You might want to have a look at the Relo plugin.
If you use regular expressions a lot, and get confused between the syntax of Java, Perl, Awk JRegex and what not, then use the QuickREx plugin.
I only differ from your answers in a couple of places.
Version control VSS *shudder*.
Unit tests JUnit.
Logging java.util.logging.
Style Built into Eclipse.
Postmortem debugging Java doesn’t really do core files, but Exception.printstacktrace() is similar… At least it gets you to the right line, anyways…
Performance testing and Profiling JProbe.
(And actual deployment is done by hand. Deploying to dev machines uses Ant, but I’m scared to think that people might actually deploy to production with an Ant script…)
Later,
Blake.
IDE: Emacs
Debugger: print statements
Unit tests: junit
Logging: jakarta commons logging
Continuous integration: hudson
Profiling: ‘java -Xrunhprof:help’ or, better yet, wallclock timing of a:b comparisons
Does java do core files? It can, but you don’t really want to go there.
Looks pretty similar to what I see full-time Java developers using, perhaps with some IntelliJ IDE added and junit for unit testing, cobertura for coverage. Me? Emacs, all platforms, all the time. Not as fast if I’m doing a lot of refactoring, then I’d use Eclipse.
Checkstyle and FindBugs do different things; Findbugs checks the compiled bytecode for error patterns while Checkstyle scans the source for fomat compliance.
If you are looking at Findbugs, look too at PMD (http://pmd.sourceforge.net).
Also, depending on how you application is built, you might look at maven. It’s pretty slick at managing dependencies from what I have seen (selenium uses it to build).
-adam
For monitoring – especially for Java and for completeness, and doubly so for ease of use – esp if you are not all to familiar with Java… Hyperic HQ is a much better bet. And if you have Nagios already, there’s a plugin which essentially lets you suck in all your Nagios data for an easy “upgrade”.
If you have actual money to spend, Perforce for revision control (but Subversion is a pretty close second). JProbe is the best I’ve worked with yet for CPU and wall clock time profiling, but you *really* need something like PerformaSure; you’ll find and fix your real performance problems a lot faster.
I’ve used both JProbe and the corresponding Borland OptimizeIT profiler, and the Borland OptimizeIT request analyzer. The UI on the Borland stuff is quite a bit clumsier than jProbe, but the request analyzer (corresponds to PerformaSure) was extremely helpful.
If you’re building a commercial product, be *very* careful pulling in third party libraries; there can be a lot of hidden dependencies that could drag you into open source licensing hell.