使用ANT编译J2ME

编程入门 行业动态 更新时间:2024-10-27 20:30:37
本文介绍了使用ANT编译J2ME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经提到这篇文章 J2MEUsingAntwithJ2ME 。现在,我有在增加资源问题(如图像)和库(如JAR和ZIP文件)。我在 RES 文件夹复制的资源,本文中出现的,但是当我提取的.jar 文件,它没有任何资源。

I have created a J2ME project after referring to this article J2MEUsingAntwithJ2ME. Now I am having problems in adding resources (such as images) and libraries (such as jar and zip files). I have copied the resources in the res folder as shown in this article but when I extract the .jar file, it does not have any resources.

感谢

推荐答案

从该示例:

<jar basedir="${build}/preverifiedobf" jarfile="${build}/bin/${program_name}.jar" manifest="bin/MANIFEST.MF"> <fileset dir="${top}/${res}"> <include name="${package_name}/*.png"/> </fileset> </jar>

这将只包括 *。PNG 文件,这是在 / RES 文件夹中。如果您想包括更多种类,添加更多的&LT;包括&GT; 线或包括$ {包名} / **。

This will only include *.png files which are in /res folder. If you want to include more types, add more <include> lines or include "${package_name}/**".

如果您要包括现有的.jar文件的内容,您可以不能解压缩他们是这样的:

If you want to include the content of existing .jar files, you can unjar them like this:

<mkdir dir="${build}/libs"/> <unjar src="yourlibrary.jar" dest="${build}/libs" />

然后你可以再坛子里起来:

Then you can jar them up again:

<jar basedir="${build}/preverifiedobf" jarfile="${build}/bin/${program_name}.jar" manifest="bin/MANIFEST.MF"> <fileset dir="${top}/${res}"> <include name="${package_name}/*.png"/> </fileset> <fileset dir="${build}/libs"> <include name="**/*"/> </fileset> </jar>

借助的Apache Ant手册包含所有支持的标记有很多的例子。

The Apache Ant manual contains a lot of examples for all the supported tags.

更多推荐

使用ANT编译J2ME

本文发布于:2023-11-27 22:50:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639933.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ANT   J2ME

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!