File (LinkExecutable linkExecutable) { File executableFile; RegularFileProperty binaryFile = null; if (IS_47_OR_BETTER) { binaryFile = linkExecutable.getLinkedFile(); } else { try { Object linkedFile = linkExecutable.getClass().getMethod("getBinaryFile").invoke(linkExecutable); if (linkedFile instanceof RegularFileProperty) { binaryFile = (RegularFileProperty)linkedFile; } } catch (Exception e) { //noinspection CallToPrintStackTrace e.printStackTrace(); } } executableFile = binaryFile != null ? binaryFile.getAsFile().getOrNull() : null; return executableFile; }