diff options
Diffstat (limited to 'find_java')
-rwxr-xr-x | find_java/src/source/find_java.h | 2 | ||||
-rwxr-xr-x | find_java/src/source/find_java_lib.cpp | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/find_java/src/source/find_java.h b/find_java/src/source/find_java.h index 1181aa1..3b60111 100755 --- a/find_java/src/source/find_java.h +++ b/find_java/src/source/find_java.h @@ -26,7 +26,7 @@ #define MIN_JAVA_VERSION_MINOR 6
#define MIN_JAVA_VERSION (MIN_JAVA_VERSION_MAJOR * 1000 + MIN_JAVA_VERSION_MINOR)
-
+int checkJavaInPath(const CPath &path);
int findJavaInEnvPath(CPath *outJavaPath);
int findJavaInRegistry(CPath *outJavaPath);
int findJavaInProgramFiles(CPath *outJavaPath);
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);
|