J2MEPolish无法编译示例应用程序

时间:2013-10-28 21:09:29

标签: java compilation j2mepolish

我想为“Nokia / Series60E3”设备编译J2ME波兰语示例应用程序“Blank”。我收到编译错误。我究竟做错了什么?

似乎访问了父对象的私有属性,因此无法编译。如果我尝试为“Generic / AnyPhone”设备编译它,它可以正常工作。

d:\Program Files (x86)\J2ME-Polish\samples\blank>ant j2mepolish
Buildfile: d:\Program Files (x86)\J2ME-Polish\samples\blank\build.xml

init:

j2mepolish:
[j2mepolish] J2ME Polish 2.4 (2013-08-27) (GPL License)
[j2mepolish] Loading device database...
[j2mepolish] Last build was interrupted or failed, now clearing work directory...
[j2mepolish] using locale [en_US]...
[j2mepolish] assembling resources for device [Nokia/Series60E3].
[j2mepolish] preprocessing for device [Nokia/Series60E3].
[j2mepolish] processing locale code...
[j2mepolish] Warning: unable to resolve path to API "securityapi". If this leads to problems, please register this API in [apis.xml].
[j2mepolish] compiling for device [Nokia/Series60E3].
[j2mepolish-javac-Nokia/Series60E3] warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[j2mepolish-javac-Nokia/Series60E3] Compiling 595 source files to d:\Program Files (x86)\J2ME-Polish\samples\blank\build\real\Nokia\Series60E3\en_US\classes
    [javac] Internal J2ME Polish class: d:\Program Files (x86)\J2ME-Polish\samples\blank\build\real\Nokia\Series60E3\en_US\source\de\enough\polish\ui\SourcedLazyContainer.
    [javac] symbol  : variable lastPointerPressY
    [javac] location: class de.enough.polish.ui.SourcedLazyContainer
    [javac]                             this.lastPointerPressY = this.currentPointerDragY;
    [javac]                                 ^
    [javac] Internal J2ME Polish class: d:\Program Files (x86)\J2ME-Polish\samples\blank\build\real\Nokia\Series60E3\en_US\source\de\enough\polish\ui\SourcedLazyContainer.
    [javac] symbol  : variable lastPointerPressYOffset
    [javac] location: class de.enough.polish.ui.SourcedLazyContainer
    [javac]                             this.lastPointerPressYOffset = newOffset;
    [javac]                                 ^
    [javac] Internal J2ME Polish class: d:\Program Files (x86)\J2ME-Polish\samples\blank\build\real\Nokia\Series60E3\en_US\source\de\enough\polish\ui\SourcedLazyContainer.
    [javac] symbol  : variable lastPointerPressY
    [javac] location: class de.enough.polish.ui.SourcedLazyContainer
    [javac]                             this.lastPointerPressY = this.currentPointerDragY;
    [javac]                                 ^
    [javac] Internal J2ME Polish class: d:\Program Files (x86)\J2ME-Polish\samples\blank\build\real\Nokia\Series60E3\en_US\source\de\enough\polish\ui\SourcedLazyContainer.
    [javac] symbol  : variable lastPointerPressYOffset
    [javac] location: class de.enough.polish.ui.SourcedLazyContainer
    [javac]                             this.lastPointerPressYOffset = newOffset;
    [javac]                                 ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 4 errors
    [javac] An internal class of J2ME Polish could not be compiled. Please try a clean rebuild by either calling "ant clean j2mepolish" or by removing the working director
E-Polish\samples\blank\build\real".
    [javac] If an API-class was not found, you might need to define where to find the device-APIs. Following classpath has been used: [d:\Program Files (x86)\J2ME-Polish\i
les (x86)\J2ME-Polish\import\cldc-1.1.jar;d:\Program Files (x86)\J2ME-Polish\import\midp-2.0.jar;d:/Program Files (x86)/J2ME-Polish/import/nokia-ui.jar;d:/Program Files (x
jar;d:/Program Files (x86)/J2ME-Polish/import/btapi.jar;d:/Program Files (x86)/J2ME-Polish/import/m3g.jar;d:/Program Files (x86)/J2ME-Polish/import/pdaapi.jar;d:/Program F
/jsr172.jar;d:/Program Files (x86)/J2ME-Polish/import/jsr180.jar;d:/Program Files (x86)/J2ME-Polish/import/m2g.jar].

BUILD FAILED
d:\Program Files (x86)\J2ME-Polish\samples\blank\build.xml:67: Unable to compile source code for device [Nokia/Series60E3]: Compile failed; see the compiler error output f

1 个答案:

答案 0 :(得分:2)

这似乎是SourcedLazyContainer类中的一个错误。 它们引用lastPointerPressY和lastPointerPressYOffset字段,这些字段仅在设备具有指针事件时可用。 它们在Container类中定义如下:

//#ifdef polish.hasPointerEvents
/** vertical pointer position when it was pressed the last time */ 
protected int lastPointerPressY;
/** scrolloffset when this container was pressed the last time */
protected int lastPointerPressYOffset;
/** time in ms when this container was pressed the last time */
protected long lastPointerPressTime;
//#endif

由于您定位的设备没有此功能,因此未定义这些字段。 对于Generic / AnyPhone,定义了此功能,因此构建成功。 您可以尝试将“hasPointerEvents”功能添加到devices.xml / custom-devices.xml文件中,或者在ant目标中设置polish.hasPointerEvents属性。