MarteEngine: Win下执行ant脚本build.xml中的exej目标时出现的错误


Win7操作系统,执行ant脚本build.xml中的exej目标,出现如下错误信息:

BUILDFAILED
D:\eclipse-SDK-3.6.2-win32\eclipse\workspace\MarteEngine\build.xml:236:Expectingclasspathseparator';'before'Files\Java\jdk1.6.0_25\jre/lib/rt.jar'inargumentnumber1


在ProGuard网站的Troubleshooting页(http://proguard.sourceforge.net/index.html#manual/troubleshooting.html)找到

Error: Expecting class path separator ';' before 'Files\Java\...' (in Windows)

Error:Expectingclasspathseparator';'before'Files\Java\...'(inWindows)
Ifthepathofyourrun-timejarcontainsspaces,likein"ProgramFiles",youhavetoencloseitwithsingleordoublequotes,asexplainedinthesectiononfilenames.Thisisactuallytrueforallfilenamescontainingspecialcharacters,onallplatforms.

同时在http://proguard.sourceforge.net/index.html#manual/usage.html页面对File Names有如下说明

ProGuardacceptsabsolutepathsandrelativepathsforthevariousfilenamesanddirectorynames.Arelativepathisinterpretedasfollows:

relativetothebasedirectory,ifset,orotherwise
relativetotheconfigurationfileinwhichitisspecified,ifany,orotherwise
relativetotheworkingdirectory.

ThenamescancontainJavasystempropertiesdelimitedby'<'and'>'.Thesystempropertiesareautomaticallyreplacedbytheirrespectivevalues.

Forexample,<java.home>/lib/rt.jarwillautomaticallybeexpandedtosomethinglike/usr/local/java/jdk/jre/lib/rt.jar.Similarly,<user.home>willbeexpandedtotheuser'shomedirectory,and<user.dir>willbeexpandedtothecurrentworkingdirectory.

Nameswithspecialcharacterslikespacesandparenthesesmustbequotedwithsingleordoublequotes.Notethateachfilenameinalistofnameshastobequotedindividually.Alsonotethatthequotesthemselvesmayneedtobeescapedwhenusedonthecommandline,toavoidthembeinggobbledbytheshell.

Forexample,onthecommandline,youcoulduseanoptionlike'-injars"myprogram.jar":"/yourdirectory/yourprogram.jar"'.

综上,解决方法为:

将build.xml的第237行中的${java.home}/lib/rt.jar用双引号引起来。

改之前为

-libraryjars ${java.home}/lib/rt.jar;lib/lwjgl.jar;lib/slick.jar;lib/jorbis-0.0.15.jar

修改后为

长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号





    联系我们

    欢迎来到TinyMind。

    关于TinyMind的内容或商务合作、网站建议,举报不良信息等均可联系我们。

    TinyMind客服邮箱:support@tinymind.net.cn