2011-08-02 73 views
0

Im a j2me程序員。我不知道j2me-polish。 我在使用FileConnection API(jsr75.jar)和藍牙(jsr082.jar)的j2me中開發應用程序。j2me項目正常工作。幫我解決j2me-polish中的問題

但我轉換成j2me波蘭,然後它會導致一些錯誤。 對於這兩個即時通訊使用Eclipse的IDE。

我創建了一個新的J2ME拋光project.Then我將文件複製在J2ME projecct的src文件夾到「源/ src目錄」 J2ME拋光項目的文件夾中。 然後我選擇了我的j2me-polish項目,右鍵單擊它,然後選擇「屬性」,然後選擇「java build path」,我添加了諸如「btapi.jar」(\ J2ME-Polish \ import \ btapi.jar)和「pdapi.jar」(\ J2ME-Polish \ import \ pdapi.jar)。

然後我運行j2me-polish應用程序。 的下列錯誤是arised,

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 

我不知道如何解決issues.Please幫我解決了問題。

感謝&問候,

+0

問題在於您的build.xml文件,請發佈您的build.xml文件並閱讀http://www.enough.de/products/j2me-polish/documentation/building/ – binarycreations

回答

0

我得到了類似的error.But我複製了「一般默認的彩屏手機」在device.xml設置並追加它旁邊it.Change名稱,並添加「btapi」在能力,因此添加了新的自定義設備。然後我創建一個項目並將設備設置爲新設備。然後它將正常工作。

0

我有和Java ME SDK 3.0相同的問題。這是您的項目所支持的設備所包裝的問題。

該解決方案的工作:

  1. 打開項目的屬性。
  2. 轉到「平臺」部分
  3. 將設備更改爲任何設備,例如「DefaultCldcPhone1」。請不要「DefauldCldcJtw ...」。

現在,在相同窗口中的可選包列表中,您會看到更多的包以及「文件連接和PIM可選包1.0」。祝你好運。