If it is an ubuntu server you could use apt-get itself to do the installation
Ubuntu :
sudo apt-get install yui-compressor
In another reference I found , the jar file was copied to the /usr/share/yui-compressor
folder
wget http://yui.zenfs.com/releases/yuicompressor/yuicompressor-2.4.6.zip
unzip yuicompressor-2.4.6.zip
mv yuicompressor-2.4.6/build/yuicompressor-2.4.6.jar /usr/share/yui-compressor/yui-compressor.jar
Then the file yui-compressor
was created in /usr/bin/
, creating an environment variable to run your .jar file
#!/bin/sh
YUI_JAR=/usr/share/yui-compressor/yui-compressor.jar
java -jar $YUI_JAR "$*"
There are also several warnings to check your installed java version.