aboutsummaryrefslogtreecommitdiffstats
path: root/find_java/src/source/find_java_lib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'find_java/src/source/find_java_lib.cpp')
-rwxr-xr-xfind_java/src/source/find_java_lib.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/find_java/src/source/find_java_lib.cpp b/find_java/src/source/find_java_lib.cpp
index 4c04e7f..f292171 100755
--- a/find_java/src/source/find_java_lib.cpp
+++ b/find_java/src/source/find_java_lib.cpp
@@ -99,6 +99,22 @@ static int checkBinPath(CPath *inOutPath) {
return checkPath(inOutPath);
}
+// Test for the existence of java.exe in a custom path
+int checkJavaInPath(const CPath &path) {
+ SetLastError(0);
+
+ int currVersion = 0;
+ CPath temp(path);
+ currVersion = checkBinPath(&temp);
+ if (currVersion > 0) {
+ if (gIsDebug) {
+ fprintf(stderr, "Java %d found in path: %s\n", currVersion, temp.cstr());
+ }
+ }
+
+ return currVersion;
+}
+
// Search java.exe in the environment
int findJavaInEnvPath(CPath *outJavaPath) {
SetLastError(0);