devize / closure-compiler

PHP Wrapper around Google's Closure Compiler
MIT License
15 stars 4 forks source link

closure compile in windows #2

Open ShayanSolution opened 11 years ago

ShayanSolution commented 11 years ago

I am trying to use closure compile in windows, i am getting error java could not be found in PATH

i see code check shell_exec('which java') and it throws exception

Breuls commented 10 years ago

I'm not sure how java under Windows is supposed to work. Cannot test that over here; I don't have a Windows machine. Perhaps it's 'java.exe' or something alike?

Feel free to try to figure it out and do a pull request!

joshtronic commented 10 years ago

On windows you would use where instead of which (flame bait: but why are you using windows? ;)

I'm also running into a similar issue on OSX, it runs fine from the CLI but it seems which always returns null when called from the browser (works fine in Linux with a similar web dev stack)

I forked the project, my thought is that instead of the sanity check just assume java is in the path and return any errors during the actual execution which should still catch java being missing and /in theory/ resolve the issues @arslan and I are seeing.

joshtronic commented 10 years ago

Actually, I digress, seems moving to whereis on OSX is working. I'm going to add in a conditional that picks the command based on your environment.

Breuls commented 10 years ago

@arslan Does this help your issue? I'd like to merge #3 but a small test would help.