帮我解决j2me-polish中的问题

时间:2011-08-02 11:29:59

标签: java java-me mobile-application j2mepolish

我是一名j2me程序员。我不知道j2me-polish。   我在j2me中开发了一个应用程序,它使用FileConnection API(jsr75.jar)和蓝牙(jsr082.jar).j2me项目正常工作。

但我将其转换为j2me polish然后它会导致一些错误。   对于我使用eclipse ide。

我创建了一个新的j2me-polish项目。然后我将j2me项目的src文件夹中的文件复制到j2me-polish项目的“source / src”文件夹中。   然后我选择我的j2me-polish项目,右键单击它,然后我选择“属性”然后我选择“java build path”,我添加了诸如“btapi.jar”的罐子(\ J2ME-Polish \ import \ btapi) .jar)和“pdapi.jar”(\ J2ME-Polish \ import \ pdapi.jar)。

然后我运行j2me-polish应用程序。   出现以下错误,

Buildfile: C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build.xml

test:

init:

j2mepolish:   [j2mepolish] info: the license attribute is no longer supported. Please place your license.key file either to ${project.home} or to ${polish.home}.   [j2mepolish] J2ME Polish
2.0-RC4 (GPL License)   [j2mepolish] Loading device database...   [j2mepolish] Using locale [en_US]...   [j2mepolish] assembling resources for device [Generic/DefaultColorPhone].   [j2mepolish] preprocessing for device [Generic/DefaultColorPhone].   [j2mepolish] Warning: CSS-Style [focused] not found, now using the default style instead. If you use Forms or Lists, you should define the style [focused].   [j2mepolish] Warning: CSS style [title] not found, you should define it for designing the titles of screens.   [j2mepolish] processing locale code...    [j2mepolish] Warning: unable to resolve path to API "mmapi". When this leads to problems, please register this API in [apis.xml].   [j2mepolish] Warning: unable to resolve path to API "wmapi". When this leads to problems, please register this API in [apis.xml].   [j2mepolish] Warning: unable to resolve path to API "pdaapi". When this leads to problems, please register this API in [apis.xml].   [j2mepolish] Warning: unable to resolve path to API "jtwi". When this leads to problems, please register this API in [apis.xml].   [j2mepolish] compiling for device [Generic/DefaultColorPhone]. [j2mepolish-javac-Generic/DefaultColorPhone] Compiling 227 source files to C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\classes
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:15: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.BluetoothConnectionException;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:16: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.DeviceClass;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:17: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.DiscoveryAgent;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:18: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.DiscoveryListener;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:19: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.LocalDevice;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:20: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.RemoteDevice;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:21: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.ServiceRecord;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:22: package javax.bluetooth does not exist
       [javac] import javax.bluetooth.UUID;
       [javac]                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:28: cannot find symbol
       [javac] symbol: class DiscoveryListener
       [javac] public class BluetoothHandler implements DiscoveryListener {
       [javac]                                          ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:37: cannot find symbol
       [javac] symbol  : class LocalDevice
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]     private LocalDevice local = null;
       [javac]             ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:38: cannot find symbol
       [javac] symbol  : class DiscoveryAgent
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]     private static DiscoveryAgent agent = null;
       [javac]                    ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:55: cannot find symbol
       [javac] symbol  : class RemoteDevice
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]     private RemoteDevice devic = null;
       [javac]             ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:170: cannot find symbol
       [javac] symbol  : class RemoteDevice
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]     public void deviceDiscovered(RemoteDevice device, DeviceClass dclass) {
       [javac]                                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:170: cannot find symbol
       [javac] symbol  : class DeviceClass
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]     public void deviceDiscovered(RemoteDevice device, DeviceClass dclass) {
       [javac]                                                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:257: cannot find symbol
       [javac] symbol  : class ServiceRecord
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]     public void servicesDiscovered(int transID, ServiceRecord[] serviceRecord) {
       [javac]                                                 ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:443: cannot find symbol
       [javac] symbol  : class RemoteDevice
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]     private void doServiceSearch(RemoteDevice device) {
       [javac]                                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\Log.java:11: package javax.microedition.io.file does not exist
       [javac] import javax.microedition.io.file.FileConnection;
       [javac]                                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\PrinterCommands.java:12: package javax.microedition.io.file does not exist
       [javac] import javax.microedition.io.file.FileConnection;
       [javac]                                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\de\enough\polish\log\file\FileLogHandler.java:34: package javax.microedition.io.file does not exist
       [javac] import javax.microedition.io.file.FileConnection;
       [javac]                                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\de\enough\polish\log\file\FileLogHandler.java:35: package javax.microedition.io.file does not exist
       [javac] import javax.microedition.io.file.FileSystemRegistry;
       [javac]                                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:199: cannot find symbol
       [javac] symbol  : variable DiscoveryListener
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             case DiscoveryListener.INQUIRY_COMPLETED:
       [javac]                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:230: cannot find symbol
       [javac] symbol  : variable DiscoveryListener
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             case DiscoveryListener.INQUIRY_ERROR:
       [javac]                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:241: cannot find symbol
       [javac] symbol  : variable DiscoveryListener
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             case DiscoveryListener.INQUIRY_TERMINATED:
       [javac]                  ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:261: cannot find symbol
       [javac] symbol  : variable ServiceRecord
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]                         ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
       [javac]                         ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:285: cannot find symbol
       [javac] symbol  : variable SERVICE_SEARCH_ERROR
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]         if (respCode == SERVICE_SEARCH_ERROR) {
       [javac]                         ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:296: cannot find symbol
       [javac] symbol  : variable SERVICE_SEARCH_COMPLETED
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]         if (respCode == SERVICE_SEARCH_COMPLETED) {
       [javac]                         ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:330: cannot find symbol
       [javac] symbol  : variable SERVICE_SEARCH_TERMINATED
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]         if (respCode == SERVICE_SEARCH_TERMINATED) {
       [javac]                         ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:375: cannot find symbol
       [javac] symbol  : variable SERVICE_SEARCH_NO_RECORDS
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]         if (respCode == SERVICE_SEARCH_NO_RECORDS) {
       [javac]                         ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:385: cannot find symbol
       [javac] symbol  : variable SERVICE_SEARCH_DEVICE_NOT_REACHABLE
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]         if (respCode == SERVICE_SEARCH_DEVICE_NOT_REACHABLE) {
       [javac]                         ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:411: cannot find symbol
       [javac] symbol  : variable LocalDevice
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             local = LocalDevice.getLocalDevice();
       [javac]                     ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:428: cannot find symbol
       [javac] symbol  : variable DiscoveryAgent
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             if (!agent.startInquiry(DiscoveryAgent.GIAC, this)) {
       [javac]                                     ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:445: cannot find symbol
       [javac] symbol  : class UUID
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             agent.searchServices(null, new UUID[]{new UUID(0x1101)}, device,
       [javac]                                            ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:445: cannot find symbol
       [javac] symbol  : class UUID
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             agent.searchServices(null, new UUID[]{new UUID(0x1101)}, device,
       [javac]                                                       ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:480: cannot find symbol
       [javac] symbol  : class BluetoothConnectionException
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]             } catch (BluetoothConnectionException bce) {
       [javac]                      ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:482: cannot find symbol
       [javac] symbol  : variable BluetoothConnectionException
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]                 if (bce.getStatus() == BluetoothConnectionException.TIMEOUT) {
       [javac]                                        ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:531: cannot find symbol
       [javac] symbol  : class BluetoothConnectionException
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]                 } catch (BluetoothConnectionException bce) {
       [javac]                          ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\BluetoothHandler.java:538: cannot find symbol
       [javac] symbol  : variable BluetoothConnectionException
       [javac] location: class com.evolute.mbs.BluetoothHandler
       [javac]                     if (bce.getStatus() != BluetoothConnectionException.TIMEOUT) {
       [javac]                                            ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\Log.java:31: cannot find symbol
       [javac] symbol  : class FileConnection
       [javac] location: class com.evolute.mbs.Log
       [javac]             FileConnection file = (FileConnection) Connector.open(fileName);
       [javac]             ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\Log.java:31: cannot find symbol
       [javac] symbol  : class FileConnection
       [javac] location: class com.evolute.mbs.Log
       [javac]             FileConnection file = (FileConnection) Connector.open(fileName);
       [javac]                                    ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\PrinterCommands.java:112: cannot find symbol
       [javac] symbol  : class FileConnection
       [javac] location: class com.evolute.mbs.PrinterCommands
       [javac]         FileConnection file = null;
       [javac]         ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\com\evolute\mbs\PrinterCommands.java:116: cannot find symbol
       [javac] symbol  : class FileConnection
       [javac] location: class com.evolute.mbs.PrinterCommands
       [javac]             file = (FileConnection) Connector.open(LOGO_PATH + logoName
       [javac]                     ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\de\enough\polish\log\file\FileLogHandler.java:125: cannot find symbol
       [javac] symbol  : class FileConnection
       [javac] location: class de.enough.polish.log.file.FileLogHandler
       [javac]      FileConnection connection = null;
       [javac]      ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\de\enough\polish\log\file\FileLogHandler.java:130: cannot find symbol
       [javac] symbol  : variable FileSystemRegistry
       [javac] location: class de.enough.polish.log.file.FileLogHandler
       [javac]          Enumeration enumeration = FileSystemRegistry.listRoots();
       [javac]                                    ^
       [javac] C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test\Generic\DefaultColorPhone\en_US\source\de\enough\polish\log\file\FileLogHandler.java:153: cannot find symbol
       [javac] symbol  : class FileConnection
       [javac] location: class de.enough.polish.log.file.FileLogHandler
       [javac]              connection = (FileConnection) Connector.open( url, Connector.READ_WRITE );
       [javac]                            ^
       [javac] 44 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 directory "C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build\test".
       [javac] When an API-class was not found, you might need to define where to find the device-APIs. Following classpath has been used: [C:\Users\sivakumar.j1\J2ME-Polish\import\midp-2.0.jar;C:\Users\sivakumar.j1\J2ME-Polish\import\cldc-1.1.jar;]. BUILD FAILED C:\Users\sivakumar.j1\j2me_polish_workspace\transactionApp1\build.xml:114: Unable to compile source code for device [Generic/DefaultColorPhone]: Compile failed; see the compiler error output for details. Total time: Total Time: 7 seconds

我不知道如何解决这些问题。请帮我解决问题。

谢谢&的问候,

2 个答案:

答案 0 :(得分:0)

我得到了类似的错误。但我复制了device.xml中的“通用默认彩色手机”设置并将其附加到它旁边。更改名称并在功能中添加“btapi”,因此添加了新的自定义设备然后我创建一个项目并将设备设置为新设备。然后它将正常工作。

答案 1 :(得分:0)

我遇到了与Java ME SDK 3.0相同的问题。这是项目支持所选设备的包装问题。

此解决方案有效:

  1. 打开项目的属性。
  2. 转到“平台”部分
  3. 将设备更改为任何设备,例如“DefaultCldcPhone1”。请不要“DefauldCldcJtw ......”。
  4. 现在,在同一窗口中的可选包列表中,您可以看到更多包以及“文件连接和PIM可选包1.0”。祝你好运。