[22529] | 1 | /*
|
---|
| 2 | * Library of functions for the Search4j utility
|
---|
| 3 | */
|
---|
| 4 |
|
---|
[15892] | 5 | #include "libsearch4j.h"
|
---|
[15690] | 6 |
|
---|
[15892] | 7 |
|
---|
[15690] | 8 | #ifdef WINDOWS
|
---|
| 9 | //minimal launch4j stuff
|
---|
[22529] | 10 | #define NO_JAVA_FOUND 0
|
---|
| 11 | #define FOUND_JRE 1
|
---|
| 12 | #define FOUND_SDK 2
|
---|
| 13 |
|
---|
[15690] | 14 | //windows functions
|
---|
[22529] | 15 | #define popen _popen
|
---|
[15690] | 16 | #define pclose _pclose
|
---|
| 17 | #define strcmp _stricmp
|
---|
[15892] | 18 |
|
---|
[15690] | 19 | #endif /* WINDOWS */
|
---|
[15892] | 20 |
|
---|
[22529] | 21 | void replace_all ( std::string & str, std::string const & pattern, std::string const & replacement ) {
|
---|
[15892] | 22 |
|
---|
[22529] | 23 | std::string::size_type start = str.find( pattern, 0 );
|
---|
| 24 |
|
---|
| 25 | while ( start != str.npos ) {
|
---|
| 26 | str.replace( start, pattern.size(), replacement );
|
---|
| 27 | start = str.find( pattern, start+replacement.size() );
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | int process( string command, bool render ) {
|
---|
| 34 |
|
---|
[15892] | 35 | #ifdef WINDOWS
|
---|
| 36 |
|
---|
[22529] | 37 | STARTUPINFO si;
|
---|
| 38 | PROCESS_INFORMATION pi;
|
---|
| 39 | memset(&pi, 0, sizeof(pi));
|
---|
| 40 | memset(&si, 0, sizeof(si));
|
---|
| 41 | si.cb = sizeof(si);
|
---|
[15892] | 42 |
|
---|
[22529] | 43 | DWORD dwExitCode = -1;
|
---|
| 44 | char* cmd = (char*)command.c_str();
|
---|
| 45 |
|
---|
| 46 | bool result;
|
---|
| 47 | if ( render ) {
|
---|
| 48 | result = CreateProcess(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
|
---|
| 49 | } else {
|
---|
| 50 | result = CreateProcess(NULL, cmd, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | if ( result ) {
|
---|
| 54 | WaitForSingleObject(pi.hProcess, INFINITE);
|
---|
| 55 | GetExitCodeProcess(pi.hProcess, &dwExitCode);
|
---|
| 56 | CloseHandle(pi.hThread);
|
---|
| 57 | CloseHandle(pi.hProcess);
|
---|
| 58 | }
|
---|
| 59 | return dwExitCode;
|
---|
| 60 |
|
---|
[15892] | 61 | #else
|
---|
| 62 |
|
---|
| 63 | return system( command.c_str() );
|
---|
| 64 |
|
---|
| 65 | #endif
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 |
|
---|
| 69 |
|
---|
[22529] | 70 | int process_and_catch_output( string command, string &output ) {
|
---|
| 71 |
|
---|
| 72 | FILE *pPipe;
|
---|
[15892] | 73 |
|
---|
| 74 | char cmd[1024];
|
---|
| 75 | strcpy(cmd, command.c_str());
|
---|
[22529] | 76 | strcat(cmd, " 2>&1" );
|
---|
[15892] | 77 |
|
---|
[22529] | 78 | //if ( verbose ) cout << "process(): running '" << command << "'" << endl;
|
---|
| 79 | #ifdef WINDOWS
|
---|
| 80 | if( (pPipe = _popen( cmd, "rt" )) == NULL ) {
|
---|
| 81 | _pclose( pPipe );
|
---|
| 82 | #else
|
---|
| 83 | if( (pPipe = popen( cmd, "r" )) == NULL ) {
|
---|
| 84 | pclose( pPipe );
|
---|
| 85 | #endif
|
---|
| 86 | return -1;
|
---|
[15690] | 87 | }
|
---|
[22529] | 88 | //if ( verbose ) cout << "started process" << endl;
|
---|
[15892] | 89 |
|
---|
[22529] | 90 | /* Read pipe until end of file. */
|
---|
| 91 | while( !feof( pPipe ) ) {
|
---|
| 92 | char psBuffer[128];
|
---|
| 93 | //if ( verbose ) cout << "get some data" << endl;
|
---|
| 94 | if( fgets( psBuffer, 128, pPipe ) != NULL ) {
|
---|
| 95 |
|
---|
| 96 | //if ( verbose ) cout << "got: " << psBuffer << endl;
|
---|
| 97 | output.append( psBuffer );
|
---|
| 98 |
|
---|
| 99 | } else {
|
---|
| 100 | //if ( verbose ) cout << "none left" << endl;
|
---|
| 101 | }
|
---|
| 102 |
|
---|
| 103 | }
|
---|
[15892] | 104 |
|
---|
[22529] | 105 | /* Close pipe and return return value of pPipe. */
|
---|
| 106 | #ifdef WINDOWS
|
---|
| 107 | int code = _pclose( pPipe );
|
---|
| 108 | #else
|
---|
| 109 | int code = pclose( pPipe );
|
---|
| 110 | #endif
|
---|
[15892] | 111 |
|
---|
[22529] | 112 | return code;
|
---|
| 113 |
|
---|
| 114 | }
|
---|
| 115 |
|
---|
[15892] | 116 | //Jvm class methods
|
---|
[22529] | 117 |
|
---|
[20709] | 118 | Jvm::Jvm()
|
---|
| 119 | : era_(1), major_(0), minor_(0), update_(0),
|
---|
| 120 | javaHome_(),
|
---|
| 121 | isJdk_(false), healthy_(false)
|
---|
[22529] | 122 | {}
|
---|
[15892] | 123 |
|
---|
[20709] | 124 | Jvm::~Jvm()
|
---|
| 125 | {
|
---|
| 126 | // javaHome automatically destructed
|
---|
| 127 | }
|
---|
| 128 |
|
---|
| 129 |
|
---|
[22529] | 130 | void Jvm::setJavaHome( string jh ) {
|
---|
| 131 | healthy_ = true;
|
---|
| 132 | javaHome_ = jh;
|
---|
[18237] | 133 | setVersionFromExeOuput();
|
---|
[22529] | 134 | setIsJdkFromJavacPresence();
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | string Jvm::getJavaHome() {
|
---|
| 138 | return javaHome_;
|
---|
| 139 | }
|
---|
| 140 |
|
---|
| 141 | string Jvm::getExecutable() {
|
---|
| 142 | string exec = "";
|
---|
| 143 | exec.append( javaHome_ );
|
---|
[15892] | 144 |
|
---|
| 145 | #ifdef WINDOWS
|
---|
| 146 | exec.append( "\\bin\\java.exe" );
|
---|
| 147 | #endif
|
---|
| 148 |
|
---|
| 149 | #ifndef WINDOWS
|
---|
| 150 | exec.append( "/bin/java" );
|
---|
| 151 | #endif
|
---|
[22529] | 152 |
|
---|
| 153 | return exec;
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | #ifdef WINDOWS
|
---|
| 157 | string Jvm::getWinExecutable() {
|
---|
| 158 | string exec = "";
|
---|
| 159 | exec.append( javaHome_ );
|
---|
| 160 | exec.append( "\\bin\\javaw.exe" );
|
---|
| 161 | return exec;
|
---|
| 162 | }
|
---|
| 163 | #endif
|
---|
| 164 |
|
---|
| 165 |
|
---|
| 166 | string Jvm::getVersion() {
|
---|
| 167 | stringstream ss;
|
---|
| 168 | ss << era_ << "." << major_ << "." << minor_ << "_" << update_;
|
---|
| 169 | return ss.str();
|
---|
| 170 | }
|
---|
| 171 |
|
---|
| 172 | bool Jvm::check() {
|
---|
| 173 | return healthy_;
|
---|
| 174 | }
|
---|
| 175 |
|
---|
| 176 | bool Jvm::setVersionFromString( string version ) {
|
---|
| 177 | era_ = atoi( version.substr(0,1).c_str() );
|
---|
| 178 | major_ = atoi( version.substr(2,1).c_str() );
|
---|
| 179 | minor_ = atoi( version.substr(4,1).c_str() );
|
---|
| 180 | update_ = atoi( version.substr(6,2).c_str() );
|
---|
| 181 | return true;
|
---|
| 182 | }
|
---|
| 183 |
|
---|
| 184 | int Jvm::compare( Jvm otherJvm ) {
|
---|
| 185 | //era
|
---|
| 186 | if ( era_ > otherJvm.getEra() )
|
---|
| 187 | return 1;
|
---|
| 188 | else if ( era_ < otherJvm.getEra() )
|
---|
| 189 | return -1;
|
---|
| 190 |
|
---|
| 191 | //major
|
---|
| 192 | if ( major_ > otherJvm.getMajor() )
|
---|
| 193 | return 1;
|
---|
| 194 | else if ( major_ < otherJvm.getMajor() )
|
---|
| 195 | return -1;
|
---|
| 196 |
|
---|
| 197 | //minor
|
---|
| 198 | if ( minor_ > otherJvm.getMinor() )
|
---|
| 199 | return 1;
|
---|
| 200 | else if ( minor_ < otherJvm.getMinor() )
|
---|
| 201 | return -1;
|
---|
| 202 |
|
---|
| 203 | //update
|
---|
| 204 | if ( update_ > otherJvm.getUpdate() )
|
---|
| 205 | return 1;
|
---|
| 206 | else if ( update_ < otherJvm.getUpdate() )
|
---|
| 207 | return -1;
|
---|
| 208 |
|
---|
| 209 | //all the same so far, must be exactly the same
|
---|
| 210 | return 0;
|
---|
| 211 |
|
---|
| 212 | }
|
---|
| 213 |
|
---|
| 214 | int Jvm::getEra() { return era_; }
|
---|
| 215 | int Jvm::getMajor() { return major_; }
|
---|
| 216 | int Jvm::getMinor() { return minor_; }
|
---|
[20709] | 217 | int Jvm::getUpdate() { return update_; }
|
---|
[18237] | 218 |
|
---|
[20709] | 219 | bool Jvm::getIsJdk() { return isJdk_; }
|
---|
[22529] | 220 | bool Jvm::getIsJre() { return !isJdk_; }
|
---|
| 221 |
|
---|
| 222 | void Jvm::setVersionFromExeOuput() {
|
---|
| 223 | string command = "", output = "";
|
---|
| 224 | command.append( "\"" );
|
---|
| 225 | command.append( getExecutable() );
|
---|
| 226 | command.append( "\"" );
|
---|
| 227 | command.append(" -version");
|
---|
| 228 |
|
---|
| 229 | //cerr << "command: " << command << endl;
|
---|
| 230 | int result = process_and_catch_output( command, output );
|
---|
| 231 | //cerr << "output: " << output << endl;
|
---|
| 232 |
|
---|
| 233 | if ( result == 0 ) {
|
---|
| 234 | if ( strcmp( output.substr( 0, 12 ).c_str() , "java version" ) == 0 || true ) {
|
---|
| 235 | era_ = atoi( output.substr(14,1).c_str() );
|
---|
| 236 | major_ = atoi( output.substr(16,1).c_str() );
|
---|
| 237 | minor_ = atoi( output.substr(18,1).c_str() );
|
---|
| 238 | update_ = atoi( output.substr(20,2).c_str() );
|
---|
| 239 | } else {
|
---|
| 240 | healthy_=false;
|
---|
| 241 | }
|
---|
| 242 | } else {
|
---|
| 243 | healthy_ = false;
|
---|
| 244 | }
|
---|
| 245 | }
|
---|
[18237] | 246 | void Jvm::setIsJdkFromJavacPresence() {
|
---|
[22529] | 247 | string javacFile = "";
|
---|
[20709] | 248 | javacFile.append( javaHome_ );
|
---|
[18237] | 249 |
|
---|
| 250 | #ifdef WINDOWS
|
---|
| 251 | javacFile.append( "\\bin\\javac.exe" );
|
---|
| 252 | #endif
|
---|
| 253 | #ifndef WINDOWS
|
---|
| 254 | javacFile.append( "/bin/javac" );
|
---|
| 255 | #endif
|
---|
| 256 | struct stat stFileInfo;
|
---|
[20709] | 257 | isJdk_ = ( stat(javacFile.c_str(),&stFileInfo) == 0 );
|
---|
[18237] | 258 | }
|
---|
[22529] | 259 |
|
---|
[15892] | 260 | //end of Jvm class methods
|
---|
| 261 |
|
---|
[22529] | 262 |
|
---|
| 263 | #ifdef WINDOWS
|
---|
| 264 | int regSearch(HKEY hKey, const char* keyName, int searchType, char* foundJavaVer ) {
|
---|
| 265 | DWORD x = 0;
|
---|
| 266 | unsigned long size = 1024;
|
---|
| 267 | FILETIME time;
|
---|
| 268 | char buffer[1024] = {0};
|
---|
| 269 |
|
---|
| 270 | int foundJava = NO_JAVA_FOUND;
|
---|
| 271 |
|
---|
| 272 | while (RegEnumKeyEx(
|
---|
| 273 | hKey, // handle to key to enumerate
|
---|
| 274 | x++, // index of subkey to enumerate
|
---|
| 275 | buffer, // address of buffer for subkey name
|
---|
| 276 | &size, // address for size of subkey buffer
|
---|
| 277 | NULL, // reserved
|
---|
| 278 | NULL, // address of buffer for class string
|
---|
| 279 | NULL, // address for size of class buffer
|
---|
| 280 | &time) == ERROR_SUCCESS) {
|
---|
| 281 | strcpy(foundJavaVer, buffer);
|
---|
| 282 | foundJava = searchType;
|
---|
| 283 | size = 1024;
|
---|
| 284 | }
|
---|
| 285 |
|
---|
| 286 | return foundJava;
|
---|
| 287 |
|
---|
| 288 | }
|
---|
| 289 | #endif
|
---|
| 290 |
|
---|
| 291 | /*
|
---|
| 292 | * function to find java
|
---|
| 293 | * implements the logic drawn on the dl lab whiteboard in feb 08
|
---|
| 294 | * return a Jvm object which represents the jvm on disk
|
---|
| 295 | */
|
---|
| 296 | bool find( Jvm &jvm, bool use_minimum, const Jvm& minimum, bool jreOnly, bool jdkOnly, string phint, string hint, bool verbose ) {
|
---|
| 297 |
|
---|
| 298 | if ( verbose ) cout << "Searching for a JVM" << endl;
|
---|
| 299 |
|
---|
| 300 | char *javaHomeEnv = "";
|
---|
| 301 | bool jvmFound = false;
|
---|
| 302 |
|
---|
| 303 | if ( !jvmFound ) {
|
---|
| 304 |
|
---|
| 305 | //try the priority hint
|
---|
| 306 | if ( verbose ) cout << " - trying priority hint: ";
|
---|
| 307 | if ( strcmp(phint.c_str(),"") != 0 ) {
|
---|
| 308 | if ( verbose ) cout << "(" << phint << ") ";
|
---|
| 309 | jvm.setJavaHome( phint );
|
---|
| 310 | if ( jvm.check() ) {
|
---|
| 311 | if ( use_minimum ) {
|
---|
| 312 | if ( jvm.compare( minimum ) >= 0 ) {
|
---|
| 313 | jvmFound = true;
|
---|
| 314 | }
|
---|
| 315 | } else {
|
---|
| 316 | jvmFound = true;
|
---|
| 317 | }
|
---|
[18237] | 318 | }
|
---|
| 319 | if ( (jreOnly && !jvm.getIsJre() ) || (jdkOnly && !jvm.getIsJdk()) ) {
|
---|
| 320 | jvmFound = false;
|
---|
[22529] | 321 | }
|
---|
[18237] | 322 |
|
---|
[22529] | 323 | }
|
---|
| 324 | if ( verbose ) { if( jvmFound ) cout << "yes" << endl; else cout << "no" << endl; }
|
---|
| 325 | }
|
---|
| 326 |
|
---|
| 327 | if ( !jvmFound ) {
|
---|
| 328 |
|
---|
| 329 | //try JAVA_HOME
|
---|
| 330 | if ( verbose ) cout << " - trying JAVA_HOME: ";
|
---|
[20709] | 331 | javaHomeEnv = getenv( "JAVA_HOME" );
|
---|
[22529] | 332 | if ( javaHomeEnv != NULL ) {
|
---|
[20709] | 333 | if ( verbose ) cout << "(" << javaHomeEnv << ") ";
|
---|
[22529] | 334 | jvm.setJavaHome( javaHomeEnv );
|
---|
| 335 | if ( jvm.check() ) {
|
---|
| 336 | if ( use_minimum ) {
|
---|
| 337 | if ( jvm.compare( minimum ) >= 0 ) {
|
---|
| 338 | jvmFound = true;
|
---|
| 339 | }
|
---|
| 340 | } else {
|
---|
| 341 | jvmFound = true;
|
---|
| 342 | }
|
---|
[18237] | 343 | }
|
---|
| 344 | if ( (jreOnly && !jvm.getIsJre() ) || (jdkOnly && !jvm.getIsJdk()) ) {
|
---|
| 345 | jvmFound = false;
|
---|
[22529] | 346 | }
|
---|
| 347 |
|
---|
| 348 | }
|
---|
| 349 | if ( verbose ) { if( jvmFound ) cout << "yes" << endl; else cout << "no" << endl; }
|
---|
| 350 | }
|
---|
| 351 |
|
---|
| 352 | if ( !jvmFound ) {
|
---|
| 353 |
|
---|
| 354 | //try JRE_HOME
|
---|
| 355 | if ( verbose ) cout << " - trying JRE_HOME: ";
|
---|
| 356 | javaHomeEnv = getenv( "JRE_HOME" );
|
---|
| 357 | if ( javaHomeEnv != NULL ) {
|
---|
[20709] | 358 | if ( verbose ) cout << "(" << javaHomeEnv << ") ";
|
---|
[22529] | 359 | jvm.setJavaHome( javaHomeEnv );
|
---|
| 360 | if ( jvm.check() ) {
|
---|
| 361 | if ( use_minimum ) {
|
---|
| 362 | if ( jvm.compare( minimum ) >= 0 ) {
|
---|
| 363 | jvmFound = true;
|
---|
| 364 | }
|
---|
| 365 | } else {
|
---|
| 366 | jvmFound = true;
|
---|
| 367 | }
|
---|
[18237] | 368 | }
|
---|
| 369 | if ( (jreOnly && !jvm.getIsJre() ) || (jdkOnly && !jvm.getIsJdk()) ) {
|
---|
| 370 | jvmFound = false;
|
---|
[22529] | 371 | }
|
---|
[15690] | 372 |
|
---|
[22529] | 373 | }
|
---|
| 374 | if ( verbose ) { if( jvmFound ) cout << "yes" << endl; else cout << "no" << endl; }
|
---|
| 375 | }
|
---|
| 376 |
|
---|
| 377 | #ifdef WINDOWS
|
---|
| 378 | if ( !jvmFound ) {
|
---|
| 379 |
|
---|
| 380 | //try the registry - this code based on launch4j code
|
---|
| 381 | char foundJavaVer[8192] = {0};
|
---|
| 382 | int foundJava = NO_JAVA_FOUND;
|
---|
| 383 |
|
---|
| 384 | if ( verbose ) cout << " - trying the registry: "; cout.flush();
|
---|
| 385 | HKEY hKey;
|
---|
| 386 | const char jre[] = "SOFTWARE\\JavaSoft\\Java Runtime Environment";
|
---|
| 387 | const char sdk[] = "SOFTWARE\\JavaSoft\\Java Development Kit";
|
---|
| 388 |
|
---|
| 389 | if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT(jre), 0, KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, &hKey) == ERROR_SUCCESS ) {
|
---|
| 390 | foundJava = regSearch(hKey, jre, FOUND_JRE, foundJavaVer);
|
---|
| 391 | RegCloseKey(hKey);
|
---|
| 392 | }
|
---|
| 393 |
|
---|
| 394 | if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT(sdk), 0, KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, &hKey) == ERROR_SUCCESS ) {
|
---|
| 395 | foundJava = regSearch(hKey, sdk, FOUND_SDK, foundJavaVer);
|
---|
| 396 | RegCloseKey(hKey);
|
---|
| 397 | }
|
---|
| 398 |
|
---|
| 399 | if ( foundJava != NO_JAVA_FOUND ) {
|
---|
| 400 | char path[1024] = {0};
|
---|
| 401 | char keyBuffer[1024];
|
---|
| 402 | unsigned long datatype;
|
---|
| 403 | unsigned long bufferlength = 1024;
|
---|
| 404 | if (foundJava == FOUND_JRE) {
|
---|
| 405 | strcpy(keyBuffer, jre);
|
---|
| 406 | } else {
|
---|
| 407 | strcpy(keyBuffer, sdk);
|
---|
| 408 | }
|
---|
| 409 |
|
---|
| 410 | strcat(keyBuffer, "\\");
|
---|
| 411 | strcat(keyBuffer, foundJavaVer);
|
---|
| 412 |
|
---|
| 413 | if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT(keyBuffer), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
|
---|
| 414 | unsigned char buffer[1024] = {0};
|
---|
| 415 | if (RegQueryValueEx(hKey, "JavaHome", NULL, &datatype, buffer, &bufferlength) == ERROR_SUCCESS) {
|
---|
| 416 | int i = 0;
|
---|
| 417 | do {
|
---|
| 418 | path[i] = buffer[i];
|
---|
| 419 | } while (path[i++] != 0);
|
---|
| 420 | if (foundJava == FOUND_SDK) {
|
---|
| 421 | strcat(path, "\\jre");
|
---|
[18237] | 422 | }
|
---|
[22529] | 423 | if ( verbose ) cerr << "path: " << path << endl ;
|
---|
| 424 | jvm.setJavaHome( path );
|
---|
| 425 | if ( jvm.check() ) {
|
---|
| 426 | if ( use_minimum ) {
|
---|
| 427 | if ( jvm.compare( minimum ) >= 0 ) {
|
---|
| 428 | jvmFound = true;
|
---|
| 429 | }
|
---|
| 430 | } else {
|
---|
| 431 | jvmFound = true;
|
---|
| 432 | }
|
---|
| 433 | }
|
---|
[18237] | 434 | if ( (jreOnly && !jvm.getIsJre() ) || (jdkOnly && !jvm.getIsJdk()) ) {
|
---|
| 435 | jvmFound = false;
|
---|
[22529] | 436 | }
|
---|
| 437 | }
|
---|
| 438 | RegCloseKey(hKey);
|
---|
| 439 | }
|
---|
| 440 | }
|
---|
| 441 | if ( verbose ) { if( jvmFound ) cout << "yes" << endl; else cout << "no" << endl; }
|
---|
| 442 | }
|
---|
[15690] | 443 | #endif
|
---|
| 444 |
|
---|
[22529] | 445 | if ( !jvmFound ) {
|
---|
| 446 |
|
---|
| 447 | //try the hint
|
---|
| 448 | if ( verbose ) cout << " - trying hint: ";
|
---|
| 449 | if ( strcmp(hint.c_str(),"") != 0 ) {
|
---|
[15690] | 450 | if ( verbose ) cout << "(" << hint << ") ";
|
---|
[22529] | 451 | jvm.setJavaHome( hint );
|
---|
| 452 | if ( jvm.check() ) {
|
---|
| 453 | if ( use_minimum ) {
|
---|
| 454 | if ( jvm.compare( minimum ) >= 0 ) {
|
---|
| 455 | jvmFound = true;
|
---|
| 456 | }
|
---|
| 457 | } else {
|
---|
| 458 | jvmFound = true;
|
---|
| 459 | }
|
---|
[18237] | 460 | }
|
---|
| 461 | if ( (jreOnly && !jvm.getIsJre() ) || (jdkOnly && !jvm.getIsJdk()) ) {
|
---|
| 462 | jvmFound = false;
|
---|
[22529] | 463 | }
|
---|
[15690] | 464 |
|
---|
[22529] | 465 | }
|
---|
| 466 | if ( verbose ) { if( jvmFound ) cout << "yes" << endl; else cout << "no" << endl; }
|
---|
| 467 | }
|
---|
| 468 |
|
---|
| 469 |
|
---|
| 470 | return jvmFound;
|
---|
| 471 | }
|
---|