- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试启动并运行 J2ME Polish 示例项目,但很困难。
我正在使用带有 J2ME Polish 插件的 Netbeans 8.0.2。
当我尝试创建 J2ME Polish 项目 ( File
> New Project
> Java ME
> J2ME Polish Project
) 时,New Project
向导工作正常,直到我到达最后一步,此时单击 Finish
按钮不会执行任何操作。然后我必须关闭向导并手动打开项目(似乎已创建 - 尽管可能不完全?)。
接下来,我将 enough-j2mepolish-client.jar
重新定位到项目的根目录后,通过引用 Output
来修复资源投诉。
然后我尝试清理并构建项目,但我在 build.xml
窗口中收到此错误:
ant -f M:\\Netbeans\\J2ME-Polish-Project rebuild
clean:
Deleting directory M:\Netbeans\J2ME-Polish-Project\build
pre-init:
pre-load-properties:
exists.config.active:
exists.netbeans.user:
exists.user.properties.file:
load-properties:
exists.platform.active:
exists.platform.configuration:
exists.platform.profile:
basic-init:
cldc-pre-init:
cldc-init:
cdc-init:
semc-pre-init:
semc-init:
savaje-pre-init:
savaje-init:
sjmc-pre-init:
sjmc-init:
ojec-pre-init:
ojec-init:
cdc-hi-pre-init:
cdc-hi-init:
nokiaS80-pre-init:
nokiaS80-init:
post-init:
init:
j2mepolish-init:
j2mepolish:
J2ME Polish 2.4 (2013-08-27) (GPL License)
Loading device database...
Processing [7] devices...
building application for [Generic/jtwi] (1/7):
using locale [de_DE]...
java.lang.IllegalArgumentException: The property [dir.dist] is not defined in input [${dir.dist}]
at de.enough.polish.Environment.getProperty(Environment.java:537)
at de.enough.polish.Environment.writeProperties(Environment.java:452)
at de.enough.polish.ant.build.BuildSetting.getDestDir(BuildSetting.java:621)
at de.enough.polish.ant.PolishTask.initialize(PolishTask.java:1613)
at de.enough.polish.ant.PolishTask.execute(PolishTask.java:600)
at de.enough.polish.ant.PolishTask.execute(PolishTask.java:436)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
M:\Netbeans\J2ME-Polish-Project\build.xml:82: Unable to execute J2ME Polish task:
java.lang.IllegalArgumentException: The property [dir.dist] is not defined in input [${dir.dist}]
at de.enough.polish.Environment.getProperty(Environment.java:537)
at de.enough.polish.Environment.writeProperties(Environment.java:452)
at de.enough.polish.ant.build.BuildSetting.getDestDir(BuildSetting.java:621)
at de.enough.polish.ant.PolishTask.initialize(PolishTask.java:1613)
at de.enough.polish.ant.PolishTask.execute(PolishTask.java:600)
at de.enough.polish.ant.PolishTask.execute(PolishTask.java:436)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 1 second)
除了 J2ME Polish 之外,我对 Ant 也是全新的,所以也许这可能是一个简单的问题来解决(尽管我在 1 小时后还没有成功......)。
为了完整起见,这是我的 <property name="dir.dist" value="dist" />
文件:
<!-- When you are using NetBeans 5, just rename this file -->
<!-- to build.xml. You can then use the normal menu items -->
<!-- run, debug, build and so forth from within NetBeans. -->
<!-- This file controls the build process. -->
<!-- The most important target is the "j2mepolish", -->
<!-- which controls for what devices the application should -->
<!-- be created and so on. -->
<!-- -->
<!-- Call the "emulator" target to skip the obfuscation -->
<!-- and to build the example for only one handsets. -->
<!-- The default target builds and obfuscates the example. -->
<!-- -->
<!-- The full documentation can be found at -->
<!-- http://www.j2mepolish.org -->
<!-- -->
<!-- Have fun! -->
<project
name="J2ME-Polish-Project"
default="j2mepolish">
<!-- extend the default NetBeans build script: -->
<import file="nbproject/build-impl.xml"/>
<!-- The polish.home property needs to point to the directory -->
<!-- containing the J2ME Polish installation. -->
<property name="polish.home" location="P:\Program Files\J2ME-Polish" />
<!-- import global properties -->
<property file="${polish.home}/global.properties" />
<!-- Definition of the J2ME Polish task: -->
<taskdef name="j2mepolish"
classname="de.enough.polish.ant.PolishTask"
classpath="${polish.home}/lib/enough-j2mepolish-build.jar"
/>
<!-- build targets, each target can be called via "ant [name]",
e.g. "ant clean", "ant test j2mepolish" or just "ant" for calling the default-target -->
<target name="setdeploy"
description="Call this target first to set the OTA download-URL, e.g. ant setdeploy j2mepolish"
>
<property name="deploy-url" value="http://www.company.com/download/" />
</target>
<target name="enableDebug"
description="Call this target first to skip the obfuscation step, call the emulator and start the debugger, e.g. ant enableDebug j2mepolish"
>
<property name="debug" value="true" />
</target>
<target name="test"
description="Call this target first to skip the obfuscation step and call the emulator, e.g. ant test j2mepolish"
>
<property name="test" value="true" />
<property name="dir.work" value="build/test" />
</target>
<target name="j2mepolish-init"
depends="init"
>
<property name="test" value="false" />
<property name="dir.work" value="build/real" />
<property name="deploy-url" value="" />
</target>
<!-- In this target the J2ME Polish task is used. -->
<!-- It has 3 sections: -->
<!-- 1. The info-section defines some general information -->
<!-- 2. The deviceRequirements-section chooses the devices -->
<!-- for which the application is optimized. -->
<!-- 3. The build-section controls the actual build -->
<!-- process. -->
<target name="j2mepolish"
depends="j2mepolish-init"
description="This is the controller for the J2ME build process."
>
<j2mepolish>
<!-- general settings, these settings basically form the JAD-attributes. -->
<!-- Have a look at the <jad>-section for setting specialised attributes.
You can also define localized attributes in the resources/messages.txt files -->
<info
name="J2ME Polish"
version="1.3.4"
description="A simple project that uses localization."
vendorName="Enough Software"
infoUrl="http://www.j2mepolish.org"
icon="dot.png"
jarName="${polish.vendor}-${polish.name}-${polish.locale}-menu.jar"
jarUrl="${deploy-url}${polish.jarName}"
copyright="Copyright 2005 - 2011 Enough Software. All rights reserved."
deleteConfirm="Do you really want to kill me?"
/>
<!-- selection of supported devices -->
<deviceRequirements if="config.active:defined and (test or enableCompilerMode)" >
<requirement name="Identifier" value="${config.active}" />
</deviceRequirements>
<deviceRequirements if="device:defined and (test or enableCompilerMode)" unless="config.active:defined">
<requirement name="Identifier" value="${device}" />
</deviceRequirements>
<deviceRequirements unless="test or enableCompilerMode">
<requirement name="Identifier" value="${devices}" />
</deviceRequirements>
<!-- build settings -->
<!--
-->
<build
usePolishGui="true"
workDir="${dir.work}"
destDir="${dir.dist}"
compilerMode="${enableCompilerMode}"
compilerDestDir="build/classes"
compilerModePreverify="true"
>
<!-- midlets definition, NetBeans defines all MIDlets in the Ant property manifest.midlets: -->
<midlets definition="${manifest.midlets}" if="manifest.midlets:defined" />
<midlets unless="manifest.midlets:defined">
<midlet class="de.enough.polish.example.MenuMidlet" name="Example" />
</midlets>
<!-- project-wide variables - used for preprocessing. -->
<!-- You can set localized variables in the resources/messages.txt files as well. -->
<variables includeAntProperties="true" >
<!-- use the advanced menubar mode that offers near-native command handling and positioning, on BB and Android use native commands: -->
<variable
name="polish.FullScreen"
value="menu"
unless="polish.blackberry || polish.android"
/>
<variable name="polish.MenuBar.useExtendedMenuBar" value="true" />
<!-- example variables:
In your Java-code you can use the following snipet to use this variable:
//#= private static final String UPDATE_URL = "${ update-url }";
You can change the title of the sample application with the "title"-var.
-->
<variable name="update-url" value="http://www.enough.de/update" />
<variable name="title" value="J2ME Polish" />
</variables>
<!-- Here you can set the dir attribute to "resources2" for an alternative design. -->
<resources
dir="resources/base"
defaultexcludes="yes"
excludes="readme.txt"
>
<root dir="resources/customizations/${customization}" if="${customization}.enabled" />
<!-- add the localization element for created localized
versions of your application: -->
<localization locales="de_DE, en_US" unless="test" />
<localization locales="en_US" if="test" />
</resources>
<!-- obfuscator settings: do not obfuscate when the test-property is true -->
<obfuscator name="ProGuard" unless="test or polish.blackberry" >
<!--
You can set additional parameters here, e.g.:
<parameter name="optimize" value="false" />
-->
</obfuscator>
<!-- debug settings: only include debug setting when the test-property is true -->
<debug if="test or log" verbose="true" level="error">
<filter pattern="de.enough.polish.example.*" level="debug" />
<filter pattern="de.enough.polish.ui.*" level="warn" />
<!-- activate display handler to see log entries in real time:
<handler name="display" />
-->
</debug>
<!-- user defined JAD attributes can also be used: -->
<jad>
<attribute name="Nokia-MIDlet-Category" value="Game" if="polish.group.Series40" />
</jad>
<!--
This is an example for signing MIDlets with J2ME Polish.
You can set the password on the commandline by calling "ant -Dpassword=secret",
or by setting the Ant property above.
Signing is done only for MIDP/2.0 devices.
-->
<!--
<sign
key="SignMIDlet"
keystore="midlets.ks"
password="${password}"
unless="test"
/>
-->
</build>
<!-- execution of emulator(s) -->
<emulator
wait="true"
trace="class"
securityDomain="trusted"
enableProfiler="true"
enableMemoryMonitor="true"
enableNetworkMonitor="true"
if="test and not debug"
>
<!--
<parameter name="-Xjam" value="transient=http://localhost:8080/${polish.jadName}" />
-->
</emulator>
<emulator
wait="true"
trace="class"
securityDomain="trusted"
enableProfiler="false"
enableMemoryMonitor="false"
enableNetworkMonitor="false"
if="debug"
>
<!-- Attach the emulator to the NetBeans debugger: -->
<debugger name="antcall" target="connect-debugger" port="6001" />
</emulator>
</j2mepolish>
</target>
<target
name="emulator"
depends="test,j2mepolish"
description="invokes the emulator"
>
</target>
<target name="clean"
description="allows a clean build. You should call [ant clean] whenever you made changes to devices.xml, vendors.xml or groups.xml">
<delete dir="build" />
<delete dir="dist" includes="**/*" />
</target>
<target
name="cleanbuild"
description="allows a clean build. You should call [ant cleanbuild] whenever you made changes to devices.xml, vendors.xml or groups.xml"
depends="clean, j2mepolish"
/>
<target name="debug" description="debugs the project" depends="enableDebug, test, j2mepolish" />
<target name="deploy"
description="Deploys the applications. Currently empty."
depends="j2mepolish"
/>
<target name="enableBarbie">
<property name="customization" value="Barbie" />
<property name="Barbie.enabled" value="true" />
</target>
<target name="barbie"
description="customizes this project with the settings found in resources/customizations/Barbie"
depends="enableBarbie, j2mepolish"
/>
<target name="enableFrogger">
<property name="customization" value="Frogger" />
<property name="Frogger.enabled" value="true" />
</target>
<target name="frogger"
description="customizes this project with the settings found in resources/customizations/Barbie"
depends="enableFrogger, j2mepolish"
/>
<target name="enableAnimations">
<property name="customization" value="Animations" />
<property name="Animations.enabled" value="true" />
<property name="polish.MenuBar.useExtendedMenubar" value="true" />
</target>
<target name="animations"
description="customizes this project with the settings found in resources/customizations/Animations"
depends="enableAnimations, j2mepolish"
/>
<target
name="build-all"
description="Builds your application in all customizations."
>
<subant target="j2mepolish" buildpath="." genericantfile="build.xml" inheritall="false" ></subant>
<subant target="frogger" buildpath="." genericantfile="build.xml" inheritall="false" ></subant>
<subant target="barbie" buildpath="." genericantfile="build.xml" inheritall="false" ></subant>
<subant target="animations" buildpath="." genericantfile="build.xml" inheritall="false" ></subant>
</target>
<!-- NetBeans specific build targets: -->
<target name="run"
depends="test, j2mepolish"
>
</target>
<target name="rebuild"
depends="clean, j2mepolish"
>
</target>
<target name="rebuild-all"
depends="clean, j2mepolish"
>
</target>
<target name="jar"
depends="j2mepolish"
>
</target>
<target name="jar-all"
depends="j2mepolish"
>
</target>
<target name="clean-all"
depends="clean"
>
</target>
<target name="deploy-all"
depends="deploy"
>
</target>
<target name="enable-compiler-mode">
<property name="enableCompilerMode" value="true" />
</target>
<target name="compile-single"
depends="enable-compiler-mode, j2mepolish"
>
</target>
<target name="connect-debugger">
<property name="jpda.port" value="${polish.debug.port}" />
<antcall target="nbdebug"/>
</target>
</project>
非常感谢任何帮助。
更新:(2015 年 2 月 17 日)我已经添加了 <property name="dir.work" value="build/real" />
(就在现有 ojit_code 行之后),但现在在尝试清理/构建项目时收到此错误:
ant -f M:\\Netbeans\\J2ME-Polish-Project rebuild
clean:
Deleting directory M:\Netbeans\J2ME-Polish-Project\build
pre-init:
pre-load-properties:
exists.config.active:
exists.netbeans.user:
exists.user.properties.file:
load-properties:
exists.platform.active:
exists.platform.configuration:
exists.platform.profile:
basic-init:
cldc-pre-init:
cldc-init:
cdc-init:
semc-pre-init:
semc-init:
savaje-pre-init:
savaje-init:
sjmc-pre-init:
sjmc-init:
ojec-pre-init:
ojec-init:
cdc-hi-pre-init:
cdc-hi-init:
nokiaS80-pre-init:
nokiaS80-init:
post-init:
init:
j2mepolish-init:
j2mepolish:
J2ME Polish 2.4 (2013-08-27) (GPL License)
Loading device database...
Processing [7] devices...
building application for [Generic/jtwi] (1/7):
using locale [de_DE]...
M:\Netbeans\J2ME-Polish-Project\build.xml:83: build.xml line 0: found no operator before symbol [.enabled] in term [${customization}.enabled] (both symbol and term might be simplified).
BUILD FAILED (total time: 1 second)
最佳答案
我从未深入了解这个特定的错误消息,但我最终设法启动并运行了另一个 J2ME Polish 演示项目 - 从那时起我可以根据我的要求调整该项目。
基本上,我对 Netbeans 8.0 没有什么兴趣,所以我使用了 Netbeans 7.2.1。对我有用的演示项目(您在 J2ME Polish New Project 向导的最后一步中选择的)是 datefield 项目。
我还发现选择特定设备来编译项目非常重要 - 我刚刚选择了 Generic/midp2
设备(位于向导)并确保在构建项目时将其选择为当前配置。
我预计还会有许多其他的变体也能起作用,但经过一番折腾后,这个组合最终对我有用 - 所以希望这对其他人来说是一个很好的起点。
关于java - J2ME Polish - 无法执行 J2ME Polish 任务 : java. lang.IllegalArgumentException : The property [dir. dist] 未在输入 [${dir.dist}] 中定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28548425/
Task.WaitAll 方法等待所有任务,Task.WaitAny 方法等待一个任务。如何等待任意N个任务? 用例:下载搜索结果页面,每个结果都需要一个单独的任务来下载和处理。如果我使用 WaitA
我正在查看一些像这样的遗留 C# 代码: await Task.Run(() => { _logger.LogException(LogLevel.Error, mes
如何在 Linux 中运行 cron 任务? 关注此Q&A ,我有这个 cron 任务要运行 - 只是将一些信息写入 txt 文件, // /var/www/cron.php $myfile = fo
原谅我的新手问题,但我想按顺序执行三个任务并在剧本中使用两个角色: 任务 角色 任务 角色 任务 这是我到目前为止(任务,角色,任务): --- - name: Task Role Task ho
我有一个依赖于 installDist 的自定义任务 - 不仅用于执行,还依赖于 installDist 输出: project.task('run', type: JavaExec, depends
从使用 Wix 创建的 MSI 运行卸载时,我需要在尝试删除任何文件之前强行终止在后台运行的进程。主要应用程序由一个托盘图标组成,它反射(reflect)了 bg 进程监控本地 Windows 服务的
我想编写 Ant 任务来自动执行启动服务器的任务,然后使用我的应用程序的 URL 打开 Internet Explorer。 显然我必须执行 startServer先任务,然后 startApplic
使用 ASP.NET 4.5,我正在尝试使用新的 async/await 玩具。我有一个 IDataReader 实现类,它包装了一个特定于供应商的阅读器(如 SqlDatareader)。我有一个简
使用命令 gradle tasks可以得到一份所有可用任务的报告。有什么方法可以向此命令添加参数并按任务组过滤任务。 我想发出类似 gradle tasks group:Demo 的命令筛选所有任务并
除了sshexec,还有什么办法吗?任务要做到这一点?我知道您可以使用 scp 复制文件任务。但是,我需要执行其他操作,例如检查是否存在某些文件夹,然后将其删除。我想使用类似 condition 的东
假设我有字符串 - "D:\ApEx_Schema\Functions\new.sql@@\main\ONEVIEW_Integration\3" 我需要将以下内容提取到 diff 变量中 - 文档名
我需要编写一个 ant 任务来确定某个文件是否是只读的,如果是,则失败。我想避免使用自定义选择器来为我们的构建系统的性质做这件事。任何人都有任何想法如何去做?我正在使用 ant 1.8 + ant-c
这是一个相当普遍的计算机科学问题,并不特定于任何操作系统或框架。 因此,我对与在线程池上切换任务相关的开销感到有些困惑。在许多情况下,给每个作业分配自己的特定线程是没有意义的(我们不想创建太多硬件线程
我正在使用以下 Ansible playbook 一次性关闭远程 Ubuntu 主机列表: - hosts: my_hosts become: yes remote_user: my_user
如何更改 Ant 中的当前工作目录? Ant documentation没有 任务,在我看来,最好的做法是不要更改当前工作目录。 但让我们假设我们仍然想这样做——你会如何做到这一点?谢谢! 最佳答案
是否可以运行 cronjob每三天一次?或者也许每月 10 次。 最佳答案 每三天运行一次 - 或更短时间在月底运行一次。 (如果上个月有 31 天,它将连续运行 2 天。) 0 0 */3 * *
如何在 Gradle 任务中执行托管在存储库中的工具? 在我的具体情况下,我正在使用 Gradle 构建一个 Android 应用程序。我添加了一项任务,将一些 protobuf 数据从文本编码为二进
我的项目有下一个结构: Root |- A |- C (depends on A) \- B (depends on A) 对于所有子项目,我们使用自己的插件生成资源:https://githu
我设置了一个具有4个节点的Hadoop群集,其中一个充当HDFS的NameNode以及Yarn主节点。该节点也是最强大的。 现在,我分发了2个文本文件,一个在node01(名称节点)上,一个在node
在 TFS 2010 中为多个用户存储任务的最佳方式是什么?我只能为一项任务分配一个。 (例如:当我计划向所有开发人员演示时) (这是一个 Scrum Msf 敏捷项目,其中任务是用户故事的一部分)
我是一名优秀的程序员,十分优秀!