List of usage examples for org.apache.hadoop.util Shell getQualifiedBinPath
public static String getQualifiedBinPath(String executable) throws IOException
From source file:org.apache.slider.common.tools.SliderUtils.java
License:Apache License
/** * Check for any needed libraries being present. On Unix none are needed; * on windows they must be present//from w w w .ja va 2 s.c om * @return true if all is well */ public static String checkForRequiredNativeLibraries() { if (!Shell.WINDOWS) { return ""; } StringBuilder errorText = new StringBuilder(""); if (!NativeIO.isAvailable()) { errorText.append("No native IO library. "); } try { String path = Shell.getQualifiedBinPath("winutils.exe"); log.debug("winutils is at {}", path); } catch (IOException e) { errorText.append("No WINUTILS.EXE. "); log.warn("No winutils: {}", e, e); } try { File target = new File("target"); FileUtil.canRead(target); } catch (UnsatisfiedLinkError e) { log.warn("Failing to link to native IO methods: {}", e, e); errorText.append("No native IO methods"); } return errorText.toString(); }