MOJO-1965: Building on Linux fails to mark the Java stub as executable if it wasn't already
Fixed.
[Refactoring] Extract code into a separate method