< prev index next >

src/os/windows/vm/os_windows.cpp

Print this page

        

@@ -151,15 +151,10 @@
   return result;
 }
 
 // Implementation of os
 
-bool os::getenv(const char* name, char* buffer, int len) {
-  int result = GetEnvironmentVariable(name, buffer, len);
-  return result > 0 && result < len;
-}
-
 bool os::unsetenv(const char* name) {
   assert(name != NULL, "Null pointer");
   return (SetEnvironmentVariable(name, NULL) == TRUE);
 }
 

@@ -187,12 +182,15 @@
     char *home_path;
     char *dll_path;
     char *pslash;
     char *bin = "\\bin";
     char home_dir[MAX_PATH];
+    char *alt_home_dir = ::getenv("_ALT_JAVA_HOME_DIR");
 
-    if (!getenv("_ALT_JAVA_HOME_DIR", home_dir, MAX_PATH)) {
+    if (alt_home_dir != NULL)  {
+      strcpy(home_dir, alt_home_dir);
+    } else {
       os::jvm_path(home_dir, sizeof(home_dir));
       // Found the full path to jvm.dll.
       // Now cut the path to <java_home>/jre if we can.
       *(strrchr(home_dir, '\\')) = '\0';  // get rid of \jvm.dll
       pslash = strrchr(home_dir, '\\');

@@ -5928,6 +5926,5 @@
   // restore globals
   UseLargePagesIndividualAllocation = old_use_large_pages_individual_allocation;
   UseNUMAInterleaving = old_use_numa_interleaving;
 }
 #endif // PRODUCT
-
< prev index next >