I’d like to put the yuicompressor jar file in a single folder so that I can call
java -jar yuicompressor-2.4.2.jar ...
from anywhere on my system, with cygwin. For bash files I use I simply put them in a common folder, and added the folder’s path to my windows user’s PATH environment variable and the bash commands were found in cygwin.
when I echo $PATH I see the folder I put the yuicompressor jar into listed in the $PATH..
But when I try java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js (for example) I get the following error message:
Unable to access jarfile yuicompressor-2.4.2.jar
Even when I try providing an absolute path to the jarfile I get the same error message..
How can I do this?
The
PATHenvironment variable is a list of directories the shell will search through in an attempt to run a command.java.exewill not search the directories on thePATHenvironment variable to try and locate the archive you are attempting to run. So runningjava -jar yuicompressor-2.4.2.jarfrom 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?