我已经开发了J2ME应用程序。当我试图通过build.xml文件编译我的应用程序时,我得到了以下错误"D:\sakina\TTMF_Project\TTMFMobileClient\src\ConfigurationUtil.java:3:找不到符号[javac]符号:类ResourceBundle[javac]位置:包java.util[javac]导入java.util.ResourceBundle;[javac]^"
有人能告诉我是否必须在build.xml文件中添加任何内容吗
<!-- define the installation folder of J2ME Polish -->
<property name="polish.home" location="C:Program FilesJ2ME-Polish" />
<!-- define the installation folder of the WTK -->
<property name="wtk.home" location="C:WTK2.5.2_01" />
<property name="device" value="Generic/midp2cldc11" />
<property name="devices" value="${device},Generic/AnyMsaPhone,Nokia/Series40E3,Nokia/Series60E3,Sony-Ericsson/JavaPlatform7,Sony-Ericsson/JavaPlatform8"/>
<!-- define the J2ME Polish task, classpath on one line please -->
<property name="polish.client.source" value="${polish.home}/j2mepolish-src/j2me/src/" />
<taskdef
name="j2mepolish"
classname="de.enough.polish.ant.PolishTask"
classpath="${polish.home}/lib/enough-j2mepolish-build.jar:${polish.home}/lib/jdom.jar" />
<!-- start the build with J2ME Polish -->
<target name="j2mepolish" depends="init">
<j2mepolish>
<info license="GPL" name="TTMFMobile" version="1.0.0" jarname="TTMFMobile.jar" deletenotify="Do you really want to exit?" />
<deviceRequirements>
<requirement name="Identifier" value="${device}" />
</deviceRequirements>
<build usePolishGui="true" fullscreen = "yes">
<midlets>
<midlet name="TMF" class="TTMFMobile" />
</midlets>
<libraries>
<!--<library file="${polish.home}/import/BlackBerry-5.0.0.jar" />-->
<library file="${polish.home}/import/json-1.0.jar" />
</libraries>
<variables includeAntProperties="true" >
<variable name="polish.TextField.showInputInfo" value="false"/>
<variable name="polish.TextField.useDirectInput" value="false" />
<variable name="polish.TextField.suppressDeleteCommands" value="false"/>
<variable name="polish.TextField.suppressClearCommands" value="true"/>
</variables>
<obfuscator name="ProGuard" unless="test or polish.blackberry" />
<resources dir="${resource.dir}" defaultexcludes="yes" excludes="readme.txt">
</resources>
<jad>
<attribute name="MIDlet-Icon" value=""/>
</jad>
</build>
<emulator />
</j2mepolish>
</target>
<target name="clean">
<delete dir="build" />
<delete dir="dist" />
</target>
<target name="init">
<property name="resource.dir" value="res" />
<property name="path.deploy" value="deployed"/>
</target>
ConfigurationUtil.java文件::
public class ConfigurationUtil {
private static ResourceBundle objResourceBundle = ResourceBundle.getBundle("ApplicationResources");
public static String getConfigValue(String configName){
String configValue = objResourceBundle.getString(configName);
return configValue;
}
}
您需要在ConfigurationUtil.java中检查代码在生成过程中,此文件中发生了编译。修复错误并重新生成它应该可以工作。