I'm using the j2me-maven-plugin in some projects with lwuit, and I had
a java.lang.OutOfMemoryError when I was running emulator. It was
because default heapsize (1M) was too small.
I didn't find how to change the heapsize on emulator. So I change the
source of om.pyx4me.maven.j2me.WtkRunMojo and made work for me (with
antenna) in <configuration><heapsize>16M</heapsize></configuration>.
Below the patch if someone need too, but I don't have sure if it's
enough for all situations.
thanks a lot
Luciano
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/mertins/
Desenvolvimento/java/Geral/terceiros/maven/pyx4me/pyx4me-maven-plugins/
j2me-maven-plugin/src/main/java/com/pyx4me/maven/j2me
# This patch can be applied using context Tools: Patch action on
respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: WtkRunMojo.java
--- WtkRunMojo.java Base (BASE)
+++ WtkRunMojo.java Locally Modified (Based On LOCAL)
@@ -47,6 +47,13 @@
*/
protected String device;
+ /**
+ * The size of heap on device
+ *
+ * @parameter expression="${j2me.heapsize}" default-value="1M"
+ */
+ protected String heapsize;
+
public void execute() throws MojoExecutionException,
MojoFailureException {
executeRun(this, classifier, false, device);
}
@@ -66,10 +73,9 @@
WtkRun task = new WtkRun();
mojo.initTask(task);
-
task.setDevice(device);
+ task.setHeapsize(heapsize);
setFileValue(task, "setJadFile",
mojo.getJadFile(packageClassifier));
return task;
}
-
}