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

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

BUILD FAILED
D:\eclipse-SDK-3.6.2-win32\eclipse\workspace\MarteEngine\build.xml:236: Expecting class path separator ';' before 'Files\Java\jdk1.6.0_25\jre/lib/rt.jar' in argument number 1


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

Error: Expecting class path separator ';' before 'Files\Java\...' (in Windows)
    If the path of your run-time jar contains spaces, like in "Program Files", you have to enclose it with single or double quotes, as explained in the section on file names. This is actually true for all file names containing special characters, on all platforms.

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

ProGuard accepts absolute paths and relative paths for the various file names and directory names. A relative path is interpreted as follows:

    relative to the base directory, if set, or otherwise
    relative to the configuration file in which it is specified, if any, or otherwise
    relative to the working directory.

The names can contain Java system properties delimited by '<' and '>'. The system properties are automatically replaced by their respective values.

For example, <java.home>/lib/rt.jar will automatically be expanded to something like /usr/local/java/jdk/jre/lib/rt.jar. Similarly, <user.home> will be expanded to the user's home directory, and <user.dir> will be expanded to the current working directory.

Names with special characters like spaces and parentheses must be quoted with single or double quotes. Note that each file name in a list of names has to be quoted individually. Also note that the quotes themselves may need to be escaped when used on the command line, to avoid them being gobbled by the shell.

For example, on the command line, you could use an option like '-injars "my program.jar":"/your directory/your program.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

修改后为

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


——————————————————————————————————
傲轩游戏网
原文地址:https://www.cnblogs.com/cuizhf/p/2379739.html