110 111 if (home.empty() == false) { 112 result += FilePath::IncludeTrailingSeparater(home) + _T(".local"); 113 } 114 115 return result; 116 } 117 118 ISectionalPropertyContainer* LinuxPlatform::GetConfigFile(TString FileName) { 119 IniFile *result = new IniFile(); 120 121 if (result->LoadFromFile(FileName) == false) { 122 // New property file format was not found, attempt to load old property file format. 123 Helpers::LoadOldConfigFile(FileName, result); 124 } 125 126 return result; 127 } 128 129 TString LinuxPlatform::GetBundledJVMLibraryFileName(TString RuntimePath) { 130 #ifdef USE_JLI_LAUNCH 131 TString result = FilePath::IncludeTrailingSeparater(RuntimePath) + 132 "lib/"JAVAARCH"/jli/libjli.so"; 133 134 if (FilePath::FileExists(result) == false) { 135 result = FilePath::IncludeTrailingSeparater(RuntimePath) + 136 "lib/"JAVAARCH"/jli/libjli.so"; 137 } 138 #else 139 TString result = FilePath::IncludeTrailingSeparater(RuntimePath) + 140 "jre/lib/"JAVAARCH"/client/libjvm.so"; 141 142 if (FilePath::FileExists(result) == false) { 143 result = FilePath::IncludeTrailingSeparater(RuntimePath) + 144 "jre/lib/"JAVAARCH"/server/libjvm.so"; 145 } 146 147 if (FilePath::FileExists(result) == false) { 148 result = FilePath::IncludeTrailingSeparater(RuntimePath) + 149 "lib/"JAVAARCH"/server/libjvm.so"; 150 } 151 152 if (FilePath::FileExists(result) == false) { 153 result = FilePath::IncludeTrailingSeparater(RuntimePath) + 154 "lib/"JAVAARCH"/server/libjvm.so"; 155 } 156 #endif 157 158 return result; 159 } 160 161 TString LinuxPlatform::GetSystemJRE() { 162 if (GetAppCDSState() != cdsDisabled) { 163 //TODO throw exception 164 return _T(""); 165 } 166 167 TString result; 168 TString jreHome = GetEnv("JRE_HOME"); 169 170 if (jreHome.empty() == false) { 171 result = FilePath::IncludeTrailingSeparater(jreHome); 172 173 if (FilePath::FileExists(result + _T("lib/rt.jar")) == false) { 174 result = FilePath::IncludeTrailingSeparater(jreHome) + _T("jre"); 175 176 if (FilePath::FileExists(result + _T("/lib/rt.jar")) == false) { | 110 111 if (home.empty() == false) { 112 result += FilePath::IncludeTrailingSeparater(home) + _T(".local"); 113 } 114 115 return result; 116 } 117 118 ISectionalPropertyContainer* LinuxPlatform::GetConfigFile(TString FileName) { 119 IniFile *result = new IniFile(); 120 121 if (result->LoadFromFile(FileName) == false) { 122 // New property file format was not found, attempt to load old property file format. 123 Helpers::LoadOldConfigFile(FileName, result); 124 } 125 126 return result; 127 } 128 129 TString LinuxPlatform::GetBundledJVMLibraryFileName(TString RuntimePath) { 130 TString result = FilePath::IncludeTrailingSeparater(RuntimePath) + 131 "lib/"JAVAARCH"/jli/libjli.so"; 132 133 if (FilePath::FileExists(result) == false) { 134 result = FilePath::IncludeTrailingSeparater(RuntimePath) + 135 "lib/"JAVAARCH"/jli/libjli.so"; 136 } 137 138 return result; 139 } 140 141 TString LinuxPlatform::GetSystemJRE() { 142 if (GetAppCDSState() != cdsDisabled) { 143 //TODO throw exception 144 return _T(""); 145 } 146 147 TString result; 148 TString jreHome = GetEnv("JRE_HOME"); 149 150 if (jreHome.empty() == false) { 151 result = FilePath::IncludeTrailingSeparater(jreHome); 152 153 if (FilePath::FileExists(result + _T("lib/rt.jar")) == false) { 154 result = FilePath::IncludeTrailingSeparater(jreHome) + _T("jre"); 155 156 if (FilePath::FileExists(result + _T("/lib/rt.jar")) == false) { |