Yohann Martineau, blog

Posts from 2012-10

maven eclipse:eclipse maven-eclipse-plugin 2.9 NullPointerException

2012-10-04 00:16:13

If you have difficulties to generate eclipse project files (.project and .classpath) from a maven project on a debian based OS, this article is for you.

While running mvn eclipse:eclipse in my peers project, I was stuck with this issue:

[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.872s
[INFO] Finished at: Wed Oct 03 23:39:07 CEST 2012
[INFO] Final Memory: 10M/104M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse (default-cli) on project peers-doc: Execution default-cli of goal org.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse failed. NullPointerException -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Actually, apparently, maven automatically seeks jvm instances on a debian host (in /usr/lib/jvm) and tries to extract MANIFEST.MF file from jre/lib/rt.jar file in each jvm folder.

It should be verified, but apparently, as soon as it finds an rt.jar file without manifest, it fails with this annoying NullPointerException.

I found that my system had 4 different JVMs:

  • java-1.5.0-gcj-4.4
  • java-6-openjdk
  • java-6-sun-
  • jdk1.7.0_07 (installed manually)
I found that the only installed jvm with no manifest in jre/lib/rt.jar was java-1.5.0-gcj-4.4, Thus, I removed jvm java-1.5.0-gcj-4.4 (debian package gcj-4.4-base) and it solved my issue.

Hope this helps someone...

Permanent link
java, debian, development, english