Usecase
Building DropWizard using Maven via command line.
mvn package
Exception
Caused by: java.lang.IllegalArgumentException: invalid target release: 1.7
[INFO] Compiling 5 source files to /Users/mvohra/Downloads/dropwizard-master/dropwizard-util/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Dropwizard Project ................................ SUCCESS [3.439s]
[INFO] Dropwizard Utility Classes ........................ FAILURE [0.489s]
[INFO] Dropwizard Jackson Support ........................ SKIPPED
[INFO] Dropwizard Validation Support ..................... SKIPPED
[INFO] Dropwizard Configuration Support .................. SKIPPED
[INFO] Dropwizard Logging Support ........................ SKIPPED
[INFO] Dropwizard Lifecycle Support ...................... SKIPPED
[INFO] Dropwizard Metrics Support ........................ SKIPPED
[INFO] Dropwizard Jersey Support ......................... SKIPPED
[INFO] Dropwizard Servlet Support ........................ SKIPPED
[INFO] Dropwizard Jetty Support .......................... SKIPPED
[INFO] Dropwizard ........................................ SKIPPED
[INFO] Dropwizard HTTP Client ............................ SKIPPED
[INFO] Dropwizard Database Support ....................... SKIPPED
[INFO] Dropwizard JDBI Support ........................... SKIPPED
[INFO] Dropwizard Migrations ............................. SKIPPED
[INFO] Dropwizard Hibernate Support ...................... SKIPPED
[INFO] Dropwizard Authentication ......................... SKIPPED
[INFO] Dropwizard Asset Bundle ........................... SKIPPED
[INFO] Dropwizard SPDY Support ........................... SKIPPED
[INFO] Dropwizard Views .................................. SKIPPED
[INFO] Dropwizard Freemarker Views ....................... SKIPPED
[INFO] Dropwizard Mustache Views ......................... SKIPPED
[INFO] Dropwizard Test Helpers ........................... SKIPPED
[INFO] Dropwizard Example Application .................... SKIPPED
[INFO] Dropwizard Multipart Form Support ................. SKIPPED
[INFO] Dropwizard Metrics Support for Ganglia ............ SKIPPED
[INFO] Dropwizard Metrics Support for Graphite ........... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.450s
[INFO] Finished at: Thu Jul 25 23:41:25 PDT 2013
[INFO] Final Memory: 16M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project dropwizard-util: Fatal error compiling: invalid target release: 1.7 -> [Help 1]
Issue & Solution
DropWizard v0.7.0 requires JDK 1.7 or above, so please check you JAVA_HOME env variable (it is used by Maven). Make sure the JDK version is >= 1.7. Most likely the JDK version would be less than that, resulting in the above Exception. In my case it was 1.6.x, so I installed JDK 1.7.x and changed the JAVA_HOME env variable to point to new JDK Home and that solved it.