2

yuicompressorのjar ファイルを 1 つのフォルダーに入れ、呼び出せるようにしたいのですが、

java -jar yuicompressor-2.4.2.jar ...

cygwin を使用して、システムのどこからでも。私が使用するbashファイルの場合、それらを共通フォルダーに配置し、フォルダーのパスをWindowsユーザーのPATH環境変数に追加すると、bashコマンドがcygwinで見つかりました。

yuicompressor echo $PATHjar を入れたフォルダーが $PATH にリストされているのを見ると、..

しかし、java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js(たとえば)試してみると、次のエラーメッセージが表示されます。

jar ファイル yuicompressor-2.4.2.jar にアクセスできません

jarfile への絶対パスを指定しようとしても、同じエラー メッセージが表示されます。

これどうやってするの?

4

1 に答える 1

1

The PATH environment variable is a list of directories the shell will search through in an attempt to run a command.

java.exe will not search the directories on the PATH environment variable to try and locate the archive you are attempting to run. So running java -jar yuicompressor-2.4.2.jar from any directory other than the one containing the archive would be expected to fail.

What is the full command you are attempting when providing an absolute path?

于 2010-05-12T09:23:13.650 に答える