统一J2ME应用程序中的.jar和.jad文件 [英] Unification of .jar and .jad files in a J2ME application

查看:144
本文介绍了统一J2ME应用程序中的.jar和.jad文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在使用LWUIT库为移动设备开发J2ME应用程序。我的项目的构建结果包括.jar文件和.jad文件。我想知道,有没有办法将这些文件统一到一个.jar文件中?为什么应该在单个(和简单的).jad文件中提及我的应用程序的某些属性而不是jar文件的METAINF / manifest.mf文件?这确实使部署过程更加困难。

currently, I am developing a J2ME application for mobiles using LWUIT library. The build result of my project includes a .jar file along with a .jad file. I wonder, is there any way to unify these to files into a single .jar file? Why some properties of my application should be mentioned in a single (and simple) .jad file instead of the METAINF/manifest.mf file of the jar file? It really makes the deployment process more difficult.

推荐答案

历史原因是单独的 .jar .jad 文件(即使整个J2ME平台也是历史的:))。

There are historical reasons for the separate .jar and .jad files (even the whole J2ME platform is historical, too :)).

As 此学习资料描述, .jar 文件包含应用程序逻辑和资源, .jad 文件包含应用程序的元数据(名称,作者,版本,要求等)及其下载URL 。回到那个时候,当移动带宽非常昂贵时,首先只下载应用程序的元数据( .jad 文件)是完全合理的,因为它要小得多。然后,如果移动电话满足要求,并且没有安装更新版本的应用程序,则可能会实际下载应用程序( .jar 文件)。

As this learning material describes, .jar files contain the application logic and resources, and .jad files contain the metadata (name, author, version, requirements etc.) of the application along with its download URL. Back in the time, when mobile bandwidth was very expensive, it was completely reasonable to download only the metadata (.jad file) of the application first as it was much smaller. Then, if the mobile phone satisfied the requirements, and no newer version of the application was installed, the actual download of the application (.jar file) could take place.

现在,这个带宽问题并不重要,大多数J2ME构建环境也将元数据包含在 META-INF / manifest.mf 输入 .jar 文件,并生成 .jad 文件作为构建过程的副产品出于兼容性原因。

Nowadays, this bandwidth issue is not relevant and most J2ME build environments encloses the metadata also in the META-INF/manifest.mf entry of the .jar file, and produces the .jad file as a by-product of the build process for compatibility reasons.

我认为几乎所有支持J2ME的现代手机都只能使用 .jar来安装和运行应用程序。 code>文件,您只需将其复制到手机并运行即可,无需 .jad 文件。因此,要回答您的问题,而不是试图统一这两个文件,您只需忽略 .jad

I think almost every modern mobile phone that supports J2ME is able to install and run the application using only the .jar file, you just copy that to the phone and run it, no .jad file is needed. So, to answer your question, instead of trying to "unify" these two files, you can just simply ignore the .jad.

但是,当你真的需要摆脱 .jad 文件时,你必须查看开发环境的构建设置(例如NetBeans),可能有一个复选框或开关禁用 .jad 文件的生成,甚至是一个属性页面,您可以在其中编辑应用程序清单中包含的条目( manifest.mf file)。但这取决于您使用的开发环境,并且没有一般的J2ME解决方案。

However, when you really need to get rid of the .jad file, you must look around the build settings of your development environment (for example NetBeans), there may be a checkbox or a switch that disables the production of the .jad file, or even a property page where you can edit the entries included in the application manifest (manifest.mf file). But this depends on the development environment you use and there is no general J2ME solution to this.

这篇关于统一J2ME应用程序中的.jar和.jad文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆