Many people like to use ant to compile packaged Java applications, and it's easy to generate war packages running in the Java EE container, and I also saw an article on Sun's website
tutorial on using ant to package J2ME programs: http://wireless.java.sun.com/midp/articles/ant/
Test a bit, but also good, but the drawback is that the need to write their own MANIFEST.MF and jad documents, so the heart is unwilling to continue to search on Google,
Finally found a very powerful ant expansion pack, specialized packaging J2ME program, very practical: http://antenna.sourceforge.net/
You can automatically compile, precompile, generate JAR,JAD,PRC (Palm's running program), and even include scrambled code. All you have to do is change the parameters in Build.xml less.
Below take Uidemo For example, give everybody share the process of packing. (This article applies to users who have experience with Ant)
First of all, assume that you have used the ANT,ANT_HOME environment variable has been set up, the above Web site to download the Antenna-bin.jar to join Classpath
I set up a uidemo directory under D:\My folder\projects\j2me\, and took the RES,SRC two directories under J2mewtk\apps\uidemo to come here,
A build.xml file is created under the same level directory, and the Build.xml content is as follows, and only a few areas of the Chinese annotation need to be modified:
<!--Define the Wireless Toolkit home directory. Needed by the tasks. -->
<!--set the J2MEWTK path. -->
<property name= "Wtk.home" value= "C:\J2MEWTK"/>
<!--Define Some additional properties for this project. Not required. -->
<!--set MIDlet name and root path. -->
<property name= "Midlet.name" value= "Uidemo"/>
<property name= "Midlet.home" value= "." />
<!--Package everything. Most of the necessary information is
Contained in the JAD file. Also preverify The result this
Time. To obfuscate everything, set the corresponding
parameter to "true" (requires Retroguard or Proguard). The
Version parameter increments the midlet-version by one. -->
<!--settings need to be scrambled, whether to precompile, and whether version--> is automatically recognized
<wtkpackage jarfile= "${midlet.name}.jar"
Jadfile= "${midlet.name}.jad"
Obfuscate= "false"
Preverify= "true"
Autoversion= "true" >
<!--Package Our newly compiled classes and the
Resources from the WTK ' s demo application. -->
Finally run ant at the command line, it's all that simple.
Finally, incidentally, the installation of ANT, but also very simple, download back to set the environment variable ant_home to the installation directory, will%ant_home%\bin join the path to the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.