-
Archives
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- March 2010
- February 2010
- December 2009
- November 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- February 2009
- January 2009
- November 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- January 2005
- October 2004
-
Meta
Tag Archives: java
Set up JAVA_HOME to track Java Preferences.app on Mac OS X
Mac OS X’s Java Preferences.app has a pane for switching between versions of the JDK, but I just found out from a coworker (thanks, Mike!) that you can make your shell match that preference easily — just add this to … Continue reading
Simple spring integration testing
Spring has had a really nice unit test framework available for a while now, but the documentation can be a bit daunting. Here’s a super-simple example of adding dependency injection to an integration test:
How to serve a transparent 1×1 pixel GIF from a servlet
The first issue was how to build the smallest possible byte array that represents a 1×1 GIF. Using ImageMagick piped to base64 made it easy to embed into java code: convert -size 1×1 xc:transparent gif:- | base64 At servlet load … Continue reading
How to increase maven heapspace in hudson builds
If your maven-built project fails in hudson (especially when you’re using the assembly plugin) and it isn’t a compile or test failure, check the console output. If it says “java.lang.OutOfMemoryError: Java heap space”, you need to configure your hudson job … Continue reading
How to add a version number to your maven webapp
I couldn’t find a simple recipe to add a version number to a maven-built webapp. The maven-war-plugin talks about how to filter, but no simple example is given.
How to set up your Maven2 POM to support Java5
Seeing this? [bash highlight="3,4"] $ mvn compile … generics are not supported in -source 1.3 (try -source 1.5 to enable generics) [/bash] You need to tell the maven-compiler-plugin to use java 1.5. Add this to your pom.xml: <project> … <build> … Continue reading
IDEA versus Eclipse
IDEA has been giving me grief lately. Fed up with mysterious pauses, bugs in svn moves, and crashes even after performing cache-deletion voodoo in IDE, I’m back to trying Eclipse. Keystroke differences and functionality differences have been the major stumbling … Continue reading
Simple Log4J eclipse template
Do you use eclipse and log4j? Do you have a template to add a static Logger instance in classes? Do you have to manually add the import? HA! NO MORE! Under Preferences > Java > Editor > Templates, click New… … Continue reading
java rake db:migrate implementations
I was surprised that there were so many libraries that do the same thing — manage change inĀ your database schema. Here’s what I’ve found so far: Liquibase (migrations are specified in db-generic XML) migrate4j (migrations must be writted in … Continue reading
New Toys
Make friendly URLs easy with stapler Make library management hell less hellish with ivy (2.0 was just released) ACEGI is now “Spring Security,” whose new version purports lighter configuration requirements than previously. iBATIS Pipe Viewer (pv) — gives you a … Continue reading