0

我是黑莓开发(java)的初学者。我有 C/C++、Qt/QML 的经验,但没有 Java 技能。我已经成功地在模拟器和设备上使用了其他示例。但是,我从 Github 下载了代码并使用 JDK 6.0 和 7.0 导入到 Blackberry Eclipse Plug-in (Version 1.5.0)。它无法在模拟器或设备上运行并出现错误:

Packaging project Advanced UI

C:\Eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.43\components\bin\rapc.exe -quiet codename=deliverables\Standard\6.0.0\Advanced_UI -sourceroot=C:\Documents and Settings\Administrator\workspace\Advanced UI\src -import=C:\Eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.43\components\lib\net_rim_api.jar deliverables\Standard\6.0.0\Advanced_UI.rapc C:\Documents and Settings\Administrator\workspace\Advanced UI\bin

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\FieldDimensionUtilities.java:49: Warning!: method 'com.samples.toolkit.ui.FieldDimensionUtilities.getBorderHeight(Field)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\FieldDimensionUtilities.java:64: Warning!: method 'com.samples.toolkit.ui.FieldDimensionUtilities.getBorderAndPaddingWidth(Field)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\FieldDimensionUtilities.java:79: Warning!: method 'com.samples.toolkit.ui.FieldDimensionUtilities.getBorderAndPaddingHeight(Field)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\BitmapButtonField.java:52: Warning!: method 'com.samples.toolkit.ui.component.BitmapButtonField.setImage(Bitmap)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\BitmapButtonField.java:57: Warning!: method 'com.samples.toolkit.ui.component.BitmapButtonField.setFocusImage(Bitmap)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\BitmapGaugeField.java:145: Warning!: method 'com.samples.toolkit.ui.component.BitmapGaugeField.getNumValues()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\BitmapSliderField.java:222: Warning!: method 'com.samples.toolkit.ui.component.BitmapSliderField.getNumStates()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\BitmapSliderField.java:229: Warning!: method 'com.samples.toolkit.ui.component.BitmapSliderField.getColour()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\EmbossedButtonField.java:96: Warning!: method 'com.samples.toolkit.ui.component.EmbossedButtonField.setText(String)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\HyperlinkButtonField.java:1: Warning!: member data 'int _menuOrdinal' not required in class: com.samples.toolkit.ui.component.HyperlinkButtonField

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\HyperlinkButtonField.java:1: Warning!: member data 'int _menuPriority' not required in class: com.samples.toolkit.ui.component.HyperlinkButtonField

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\HyperlinkButtonField.java:144: Warning!: method 'com.samples.toolkit.ui.component.HyperlinkButtonField.getMenuText()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\HyperlinkButtonField.java:153: Warning!: method 'com.samples.toolkit.ui.component.HyperlinkButtonField.getMenuItem()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\LabeledSwitch.java:43: Warning!: member data 'boolean _selected' not required in class: com.samples.toolkit.ui.component.LabeledSwitch

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\LabeledSwitch.java:88: Warning!: method 'com.samples.toolkit.ui.component.LabeledSwitch.setOn(boolean)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\LabeledSwitch.java:93: Warning!: method 'com.samples.toolkit.ui.component.LabeledSwitch.getOnState()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\ListStyleButtonField.java:139: Warning!: method 'com.samples.toolkit.ui.component.ListStyleButtonField.setText(String)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\RatingField.java:59: Warning!: member data 'int _rop' not required in class: com.samples.toolkit.ui.component.RatingField

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\RatingField.java:109: Warning!: method 'com.samples.toolkit.ui.component.RatingField.getNumValues()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\SliderField.java:75: Warning!: member data 'int _progressWidth' not required in class: com.samples.toolkit.ui.component.SliderField

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\SliderField.java:218: Warning!: method 'com.samples.toolkit.ui.component.SliderField.getValue()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\SliderField.java:223: Warning!: method 'com.samples.toolkit.ui.component.SliderField.getNumValues()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\SwitchField.java:54: Warning!: method 'com.samples.toolkit.ui.component.SwitchField.setOn(boolean)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\SwitchField.java:59: Warning!: method 'com.samples.toolkit.ui.component.SwitchField.getOnState()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\JustifiedHorizontalFieldManager.java:58: Warning!: method 'com.samples.toolkit.ui.container.JustifiedHorizontalFieldManager.addLeftField(Field)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\JustifiedHorizontalFieldManager.java:67: Warning!: method 'com.samples.toolkit.ui.container.JustifiedHorizontalFieldManager.addRightField(Field)' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\JustifiedHorizontalFieldManager.java:139: Warning!: method 'com.samples.toolkit.ui.container.JustifiedHorizontalFieldManager.getLeftField()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\JustifiedHorizontalFieldManager.java:144: Warning!: method 'com.samples.toolkit.ui.container.JustifiedHorizontalFieldManager.getRightField()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\JustifiedVerticalFieldManager.java:102: Warning!: method 'com.samples.toolkit.ui.container.JustifiedVerticalFieldManager.getTopField()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\JustifiedVerticalFieldManager.java:107: Warning!: method 'com.samples.toolkit.ui.container.JustifiedVerticalFieldManager.getBottomField()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\TwoColumnField.java:66: Warning!: method 'com.samples.toolkit.ui.container.TwoColumnField.getLeftField()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\TwoColumnField.java:71: Warning!: method 'com.samples.toolkit.ui.container.TwoColumnField.getRightField()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\decor\BitmapMask.java:94: Warning!: method 'com.samples.toolkit.ui.decor.BitmapMask.getTop()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\decor\BitmapMask.java:99: Warning!: method 'com.samples.toolkit.ui.decor.BitmapMask.getRight()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\decor\BitmapMask.java:104: Warning!: method 'com.samples.toolkit.ui.decor.BitmapMask.getBottom()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\decor\BitmapMask.java:109: Warning!: method 'com.samples.toolkit.ui.decor.BitmapMask.getLeft()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\decor\BitmapMask.java:114: Warning!: method 'com.samples.toolkit.ui.decor.BitmapMask.getWidth()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\decor\BitmapMask.java:119: Warning!: method 'com.samples.toolkit.ui.decor.BitmapMask.getHeight()' not invoked.

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\component\RatingField.java:250: Warning!: local variable(s) { isConsumed } initialized but not used in: com.samples.toolkit.ui.component.RatingField.touchEvent(TouchEvent)

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\HorizontalButtonFieldSet.java:51: Warning!: local variable(s) { availableWidth maxPreferredWidth } initialized but not used in: com.samples.toolkit.ui.container.HorizontalButtonFieldSet.sublayout(int,int)

C:\Documents and Settings\Administrator\workspace\Advanced UI\src\com\samples\toolkit\ui\container\JustifiedEvenlySpacedHorizontalFieldManager.java:40: Warning!: local variable(s) { availableWidth maxPreferredWidth } initialized but not used in: com.samples.toolkit.ui.container.JustifiedEvenlySpacedHorizontalFieldManager.sublayout(int,int)

Error: Cannot run program "jar": CreateProcess error=2, ?????????

Packaging project Advanced UI failed (took 15.953 seconds) 

如何解决这种情况?谢谢。

问候, QC

4

1 回答 1

4

确保已将 Java/bin 文件夹设置为 PATH 系统环境变量。

警告不是问题的原因。在线描述的问题:

Error: Cannot run program "jar": CreateProcess error=2, ?????????

这意味着 BlackBerry 编译器没有找到标准的 java 编译器 (javac.exe) 来继续编译过程。

通过将系统 PATH 变量设置为 JavaSDK/bin 文件夹,确保可以从任何地方访问 javac.exe 所在的文件夹。

例如,如果您已将标准 Java SDK 安装到文件夹C:\Java,则将以下字符串添加到系统 PATH 变量中:

C:\Java\bin
于 2012-04-24T22:55:47.610 回答