public static boolean commandCheck ( String nativeCommand ) { CommandExecutor executor = new CommandExecutor ( "DefinitionCheck" , "which" , nativeCommand ) ; NativeResponse res = executor . exec ( 100 ) ; return res . getStatusCode ( ) == 0 ; }
Checks if the given native command exists . No error will be thrown . The program waits for 100 milliseconds . That s enough to find out if the program exists or not .