fuixed java-environment path
fixed build problems on OS X