0

我已经开发了 J2ME 应用程序。当我尝试通过 build.xml 文件编译我的应用程序时,出现以下错误“D:\sakina\TTMF_Project\TTMFMobileClient\src\ConfigurationUtil.java:3: cannot find symbol [javac] symbol: class ResourceBundle [javac] location: package java.util [javac] 导入 java.util.ResourceBundle; [javac] ^"

谁能告诉我是否必须在 build.xml 文件中添加任何内容

<!-- define the installation folder of J2ME Polish -->
<property name="polish.home" location="C:\Program Files\J2ME-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;
    }
}
4

1 回答 1

0

您需要在 ConfigurationUtil.java 中检查您的代码 在构建期间此文件中发生了编译。修复错误并重建它应该可以工作。

于 2012-02-13T06:44:43.410 回答