Question

I am using the Assetic module for ZF2 from widmogrod.

Assetic\Filter\YUI\JsCompressorFilter is returning the following: Unable to access jarfile

Assetic\Exception\FilterException: An error occurred while running: "java" "-jar" "" "-o" "C:\WINDOWS\Temp\YUIB083.tmp" "--type" "js" "C:\WINDOWS\Temp\YUIB053.tmp" Error Output: Error: Unable to access jarfile Input: bladie bladie a-lot-of-javascript

The command is autogenerated somewhere in the code, but Java is never abled to find yuicompressor.jar. And I don't know from which path it is eventualy executed.

I have the Symfony core library loaded intp ZF2 and everything, installed Java JRE7, and now I have tried to put yuicompressor\yuicompressor.jar all over the place. And even hardcoded yuicompressor\yuicompressor.jar it at Assetic\Filter\Yui\BaseCompressorFilter.php like:

public function __construct($jarPath = '\yuicompressor\yuicompressor.jar', .........)

and also used absolute paths.......

Can anyone help me out?

Was it helpful?

Solution

what kind of path is this: \yuicompressor\yuicompressor.jar? if you're working on linux the path should be like /yuicompressor/yuicompressor.jar but it's very unlikely you want to put the jar there. on windows it would be like C:\yuicompressor\yuicompressor.jar i'm not using assetic-module anymore (wrote my own module), but that should not matter as the configutaion is not related to the zf2 module but to assetic itsself.

not depending on the operating system i'm running fine with the the jar placed under

/path/to/project/bin/yuicompressor-2.4.7.jar

resp.

C:\Path\To\Project\bin\yuicompressor-2.4.7.jar

and simply configuring the filter path like this

'bin' . DIRECTORY_SEPARATOR . 'yuicompressor-2.4.7.jar'

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top