zoukankan      html  css  js  c++  java
  • [Blackberry]Bug_build时出错_java build 编码格式问题及解决办法

      使用phonegap(cordova),在开发完ios/android版本后,近几天想弄一个黑莓的版本,故去搭建phonegap的黑莓开发环境,按照官方文档 http://docs.phonegap.com/en/2.2.0/guide_getting-started_blackberry_index.md.html#Getting%20Started%20with%20Blackberry 一步步把环境搭建好之后,兴奋地急着想看看运行的效果,但是在build/load-simulator时就被打击得不轻,出现了如下错误(错误信息摘自http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece7631043973b5e16c1743ca085482281cd1f84642c101a39feee677f5746cea7263a5df83c0fa8814a6f684275aa9a9ede4fdeb9c27b2e83206474188c42069644ef9d49739671cd0cb2f34cf0bb806dc0ecc5d2af4353bd44040ac2b7cd4d00659d25b6436da2fdc414025e60adea4172fe292777cc7219a14689b0652e47cae1dc2c5bc45bc76061c6f26aef634ea212d4081c5553a13cf64e0a7827e13f30f8352a05e2ac1db93d783075e119eeef96f6fc49fccbea468ffbbbf77cd133&p=b4759a46dc8912a05beb8c60454980&newp=8b2a9643ba934eac52aedf3953548a231615d70e37d3d579&user=baidu&fm=sc&query=decodingMap%2Eput+extension%5Cblackberry%5Ccommon%5Cutil%5CURLDecoder%2Ejava&qid=d153fa8f00edf937&p1=1):

    =========================================================

    *D:Workspacesample>ant blackberry load-simulator* 

    Buildfile: D:Workspacesampleuild.xml 

    blackberry: 

    load-simulator: 

    generate-cod-name: 

         [echo] Generated name: CordovaSample.cod 

    clean: 

       [delete] Deleting directory D:Workspacesampleuild 

    package-app: 

        [mkdir] Created dir: D:Workspacesampleuildwidget 

         [copy] Copying 8 files to D:Workspacesampleuildwidget 

          [zip] Building zip: D:WorkspacesampleuildCordovaSample.zip 

    build: 

         [exec] [INFO]       Parsing command line options 

         [exec] [INFO]       Parsing bbwp.properties 

         [exec] [INFO]       Validating application archive 

         [exec] [INFO]       Parsing config.xml 

         [exec] [WARNING]    Failed to find the <author> element 

         [exec] [INFO]       Populating application source 

         [exec] [INFO]       Compiling BlackBerry WebWorks application 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:139: 错误: 未结束的字符串文字 

         [exec]         decodingMap.put( "%80", "? ); 

         [exec]                                 ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:139: 错误: 需要';' 

         [exec]         decodingMap.put( "%80", "? ); 

         [exec]                                      ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:140: 错误: 非法的表达式开始 

         [exec]         decodingMap.put( "%81", " " ); 

         [exec]                    ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:140: 错误: 需要';' 

         [exec]         decodingMap.put( "%81", " " ); 

         [exec]                        ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:141: 

    错误: 未结束的字符串文字 

         [exec]         decodingMap.put( "%82", "? ); 

         [exec]                                 ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:141: 错误: 需要';' 

         [exec]         decodingMap.put( "%82", "? ); 

         [exec]                                      ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:142: 错误: 非法的表达式开始 

         [exec]         decodingMap.put( "%83", "? ); 

         [exec]                    ^ 

    .......................................... 

    .......................................... 

    .......................................... 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:181: 错误: 未结束的字符串文字 

         [exec]         decodingMap.put( "%AA", "? ); 

         [exec]                                 ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:182:错误: 未结束的字符串文字 

         [exec]         decodingMap.put( "%AB", "? ); 

         [exec]                                 ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:182:错误: 需要';' 

         [exec]         decodingMap.put( "%AB", "? ); 

         [exec]                                      ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:183: 错误: 非法的表达式开始 

         [exec]         decodingMap.put( "%AC", "? ); 

         [exec]                    ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:183: 

    错误: 需要';' 

         [exec]         decodingMap.put( "%AC", "? ); 

         [exec]                        ^ 

         [exec] C:Documents and SettingsAdministratorLocal 

    SettingsTempwidgetGen.165781651338115655203.tmpextensionlackberrycommonutilURLDecoder.java:183: 错误: 未结束的字符串文字 

         [exec]         decodingMap.put( "%AC", "? ); 

         [exec]                                 ^ 

         [exec] 100 个错误 

         [exec] Error!: Error: java compiler failed: D:Program FilesJavajdk1.7.0_03injavac.exe 

    @C:DOCUME~1ADMINI~1LOCALS~1Temp apc_1c33ffa2.d ... 

         [exec] [ERROR]      RAPC exception occurred 

    load-simulator: 

         [echo] Simulator directory=D:Program FilesResearch In 

    MotionBlackBerry WebWorks SDK 2.3.1.5simpack7.0.0.318 

         [echo] Simulator directory=D:Program FilesResearch In 

    MotionBlackBerry WebWorks SDK 2.3.1.5simpack7.0.0.318 

         [echo] Simulator executable=D:Program FilesResearch In 

    MotionBlackBerry WebWorks SDK 2.3.1.5simpack7.0.0.318/9930.bat 

         [echo] Closing all running simulators... 

         [exec] No sessions currently running. 

         [echo] MDS directory=D:Program FilesResearch In MotionBlackBerry 

    WebWorks SDK 2.3.1.5/mds 

    BUILD FAILED 

    D:Workspacesampleuild.xml:33: The following error occurred while 

    executing this line: 

    D:Workspacesamplelackberry.xml:123: 

    D:WorkspacesampleuildStandardInstall does not exist. 

    *机器环境:* 

    *OS- Windows XP(Chinese)* 

    *Java- jdk1.6.0_05* 

    *Ant-apache-ant-1.8.1* 

    *BlackBerry WebWorks SDK 2.3.1.5* 

    *Cordova-1.7.0* 

    ===============================================================

     
    最终在:
    找到答案。
     
     
    问题的根源来自BlackBerry WebWorks SDK:
    SDK的安装目录下的URLDecoder.java乱码,目录如:D:devResearch In MotionBlackBerry WebWorks SDK 2.3.1.5extcommonlackberrycommonutilURLDecoder.java
    而终端打印的一堆出错信息都是表象,C:Documents and SettingsAdministratorLocal 
    SettingsTemp里java文件都是来自sdk,所以我们只要把sdk下的URLDecoder.java进行下处理那可:
    在终端cd到sdk安装目录,并进入URLDecoder.java所有目录,执行如下命令。
     

    D:devResearch In MotionBlackBerry WebWorks SDK 2.3.1.5extcommonlackberrycommonutil>native2ascii -encoding ISO-8859-1 URLDecoder.java URLDecoder.java_Unicode

    D:devResearch In MotionBlackBerry WebWorks SDK 2.3.1.5extcommonlackberrycommonutil>rename URLDecoder.java URLDecoder.java_bak

    D:devResearch In MotionBlackBerry WebWorks SDK 2.3.1.5extcommonlackberrycommonutil>rename URLDecoder.java_Unicode URLDecoder.java

    结果:

    编译并打包成功,但是仍然会弹出 “Oh Snap! Build request failed with message: undefined“ 警告框,但不妨碍build和package,在相应Output路径下可以看到OTAInstall和StandardInstall两个手机端可执行文件以及.zip打包文件。

  • 相关阅读:
    C# 直接选择排序(史上最清晰,最通俗)
    Hadoop单节点伪分布式环境部署
    Hive安装和部署andMySQL安装和部署
    Kafka集群部署
    HA Hadoop完全分布式环境部署
    HBase集群部署
    Flume整合Kafka
    Hadoop完全分布式环境部署
    JavaScript正则表达式语法
    什么无线路由器性价高?买什么路由器好?
  • 原文地址:https://www.cnblogs.com/webapplee/p/3746091.html
Copyright © 2011-2022 走看看