improve gradle build on JDK8
- skip adding MaxPermSize jvm arg
Merge branch '2.4.x' into 2.5.x