in Eclipse, Maven

Maven integration for Eclipse JDK Warning

After installing the M2Eclipse plugin, I get this annoying warning message every time i start Eclipse :


You’d think that the only thing needed to do is adding the -vm option, pointing to the JDK.
That’s not enough ! You need to make sure the -vm option is added before the -vmargs option.
So on the first line, write -vm and on the second line (you need a line break !), write the path to your JDK installation.

In the end, here is what my eclipse.ini looks like :

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm 
D:\softs\jdk1.6.0_23\bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

And the annoying warning message is gone ! 🙂

For more explanations, I quote these lines taken from the Eclipse wiki page :

1. Each option and each argument to an option must be on its own line.
2. All lines after -vmargs are passed as arguments to the JVM, so all arguments and options for eclipse must be specified before -vmargs (just like when you use arguments on the command-line)

Links :
http://wiki.eclipse.org/Eclipse.ini