Here you can find the source of doesExecutableExist(String executablePath)
public static boolean doesExecutableExist(String executablePath)
//package com.java2s; /*//from w w w .ja v a 2s . c o m Copyright 2013 Florin Patan. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. */ import java.io.File; public class Main { public static boolean doesExecutableExist(String executablePath) { if (new File(executablePath).exists()) { return true; } String systempath = System.getenv("PATH"); String[] paths = systempath.split(File.pathSeparator); for (String path : paths) { if (new File(path, executablePath).exists()) { return true; } } return false; } }