0

Python をパス変数に設定しました。以下はパス変数の内容です。

%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\windowspowershell\v1.0\;C:\Python27\;c:\program files\java\jdk1.7.0_03\bin;.;c:\program files\tortoisesvn\bin;d:\apache-ant-1.8.3\bin;c:\program files\ibm\gsk8\lib;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;%M2_HOME%\bin;C:\Program Files\Lenovo\Bluetooth Software\;

Python を構成した理由は、ant ビルドと installj を使用して exe ファイルを作成していることを意味します

<target name="installer.izpack.exe" depends="installer.izpack" description="build release executable izpack installer">
    <exec executable="python" failonerror="true">
        <arg line="${installer.izpack.dir}/utils/wrappers/izpack2exe/izpack2exe.py"/>
        <arg line="--file=${basedir}/installer/EasyIT-installer.jar"/>
        <arg line="--output=${basedir}/installer/EasyIT-installer.exe"/>
        <arg line="--no-upx"/>
    </exec>
</target>

しかし、アプリをビルドするとエラーが発生します:

installer.izpack.exe:
     [exec] python: can't open file 'C:\Program': [Errno 2] No such file or directory

BUILD FAILED
E:\Java Projects\Spark Projects\EastIT - Copy\build\build.xml:873: exec returned: 2

Total time: 51 seconds
4

1 に答える 1

1

たとえば、スペースを含むパスがあります

c:\program files\java\jdk1.7.0_03\bin

次のように、パスを引用する必要があります。

"c:\program files\java\jdk1.7.0_03\bin"

Python について 100% 確信があるわけではありませんが、これでうまくいくはずです:

%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\windowspowershell\v1.0\;C:\Python27\;"c:\program files\java\jdk1.7.0_03 \bin";.;c:\program files\tortoisesvn\bin;d:\apache-ant-1.8.3\bin;c:\program files\ibm\gsk8\lib;C:\PROGRA~1\IBM\ SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;%M2_HOME%\bin;"C:\Program Files\Lenovo\Bluetooth Software\ ";

一部のパス コンポーネントは 8.3 の長さと互換性があるように短縮されていることに注意してください (それらには ~ が含まれています)。引用が気に入らない場合、または Python でうまくいかない場合は、次のコマンドを使用できます。

ディレクトリ/x

私のシステムなどで、各パスコンポーネントの短縮版を取得する

06/12/2012  09:09 AM    <DIR>          PROGRA~1     Program Files
06/12/2012  09:08 AM    <DIR>          PROGRA~2     Program Files (x86)
于 2012-06-13T03:13:49.307 に答える