Eclipse and J2ME support through antenna

Eclipse and J2ME support through antenna

Post by Scorpio » Thu, 21 Aug 2003 02:59:40


I wanted to build my j2me applications through Eclipse with antenna, but
i can't seem to fix this problem. When i turn preverifying on, it always
says "BUILD FAILED: <file>: Preverification failed (result=1)". Can
anyone tell me what the problem might be? The Wireless Toolkit is 2.0,
JDK is 1.4.2.

Thanks in advance.


[wtkpackage] New version is 1.8

[wtkpackage] Building jar:

[wtkpackage] Updating JAD file

[wtkpreverify] Preverifying

[wtkpreverify] BUILD FAILED:
Preverification failed (result=1)


Eclipse and J2ME support through antenna

Post by Tim Tyle » Thu, 21 Aug 2003 17:08:06

: I wanted to build my j2me applications through Eclipse with antenna

I have Eclipse set up for J2ME development here. I wound up
pretty-much ditching Ant during development. I found Ant
increased by build times to an unacceptable degree.

What I wound up doing was running the emulator from the class files
using a batch file that did preverification first:

``Since I was already launching via a batch file, I inserted
a preverify call there.

This is slightly inefficient if performing multiple runs -
but essentially everything now works at a reasonable speed -
and is fairly neat.

This method bypasses the need to make a jar file - or to
insert its length in the JAD file.'' - TT.

I still have an Ant task that bundles things into a Jar for deployment -
but I used

"Preverification failed" may be an indication that you are using a
non-J2ME API.

There should be a proper error message somewhere if so - perhaps preverify
manually to uncover it.

Here are my original instructions for launching via a batch file:

``I found out how to run midlets in Eclipse under windows.

Other folk seem to:

* Use the WTK KToolbar, or:
* Use WSDD.

The trick is much the same as the one used for the MS JVM:

You set up a second "Installed JRE" - using the preferences - and have
it point to an installed JRE.

Then in the "bin" directory of that you make a batch file - called:


This contains one line:

C:\Program1\Java\WTK20\bin\emulator %6 %7 %8

Then you use a run configuration, set it to use the new JRE,
use these as your "Program arguments":

-classpath C:\Docs\Java\xyz.jar -Xdescriptor:C:\Docs\Java\xyz.jad


"midp_emulator.bat" your Java executable. The "Main class" can be set to anything.

That's all.''
|im |yler @XXXXX.COM


Eclipse and J2ME support through antenna

Post by Scorpio » Thu, 21 Aug 2003 18:43:30

Thanks for your suggestions, i'll try the batch thing out, i have a good
feeling about it :)

I've done manual preverify'ing on the jar file, and on the seperate
class files, but both give no trouble. That's why i find it so strange
that antenna *does* return an error.

Thanks again, i'll try it out!