comparison src/os/windows/vm/os_windows.cpp @ 14317:b59507f713e0

8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher Summary: decoupled the '-XXaltjvm=<path>' option from the gamma launcher. Clearing the way for removing the remaining cruft associated with the previously removed gamma launcher. Reviewed-by: dcubed, dholmes
author rdurbin
date Thu, 30 Jan 2014 14:12:22 -0800
parents 5944dba4badc
children 6c9332549827
comparison
equal deleted inserted replaced
14316:c888354aaa35 14317:b59507f713e0
1808 strcpy(buf, saved_jvm_path); 1808 strcpy(buf, saved_jvm_path);
1809 return; 1809 return;
1810 } 1810 }
1811 1811
1812 buf[0] = '\0'; 1812 buf[0] = '\0';
1813 if (Arguments::created_by_gamma_launcher()) { 1813 if (Arguments::sun_java_launcher_is_altjvm()) {
1814 // Support for the gamma launcher. Check for an 1814 // Support for the java launcher's '-XXaltjvm=<path>' option. Check
1815 // JAVA_HOME environment variable 1815 // for a JAVA_HOME environment variable and fix up the path so it
1816 // and fix up the path so it looks like 1816 // looks like jvm.dll is installed there (append a fake suffix
1817 // libjvm.so is installed there (append a fake suffix 1817 // hotspot/jvm.dll).
1818 // hotspot/libjvm.so). 1818 char* java_home_var = ::getenv("JAVA_HOME");
1819 char* java_home_var = ::getenv("JAVA_HOME"); 1819 if (java_home_var != NULL && java_home_var[0] != 0) {
1820 if (java_home_var != NULL && java_home_var[0] != 0) { 1820 strncpy(buf, java_home_var, buflen);
1821 1821
1822 strncpy(buf, java_home_var, buflen); 1822 // determine if this is a legacy image or modules image
1823 1823 // modules image doesn't have "jre" subdirectory
1824 // determine if this is a legacy image or modules image 1824 size_t len = strlen(buf);
1825 // modules image doesn't have "jre" subdirectory 1825 char* jrebin_p = buf + len;
1826 size_t len = strlen(buf); 1826 jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\");
1827 char* jrebin_p = buf + len; 1827 if (0 != _access(buf, 0)) {
1828 jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\"); 1828 jio_snprintf(jrebin_p, buflen-len, "\\bin\\");
1829 if (0 != _access(buf, 0)) { 1829 }
1830 jio_snprintf(jrebin_p, buflen-len, "\\bin\\"); 1830 len = strlen(buf);
1831 } 1831 jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll");
1832 len = strlen(buf); 1832 }
1833 jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll"); 1833 }
1834 } 1834
1835 } 1835 if (buf[0] == '\0') {
1836 1836 GetModuleFileName(vm_lib_handle, buf, buflen);
1837 if(buf[0] == '\0') {
1838 GetModuleFileName(vm_lib_handle, buf, buflen);
1839 } 1837 }
1840 strcpy(saved_jvm_path, buf); 1838 strcpy(saved_jvm_path, buf);
1841 } 1839 }
1842 1840
1843 1841