Changeset 17302
- Timestamp:
- 2008-09-17T11:59:00+12:00 (16 years ago)
- Location:
- release-kits/shared/search4j
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/shared/search4j/libsearch4j.cpp
r15897 r17302 293 293 * return a Jvm object which represents the jvm on disk 294 294 */ 295 bool find( Jvm &jvm, bool use_minimum, Jvm minimum, string hint, bool verbose ) {295 bool find( Jvm &jvm, bool use_minimum, Jvm minimum, string phint, string hint, bool verbose ) { 296 296 297 297 if ( verbose ) cout << "Searching for a JVM" << endl; … … 300 300 bool jvmFound = false; 301 301 302 if ( !jvmFound ) { 303 304 //try the priority hint 305 if ( verbose ) cout << " - trying priority hint: "; 306 if ( strcmp(phint.c_str(),"") != 0 ) { 307 if ( verbose ) cout << "(" << phint << ") "; 308 jvm.setJavaHome( phint ); 309 if ( jvm.check() ) { 310 if ( use_minimum ) { 311 if ( jvm.compare( minimum ) >= 0 ) { 312 jvmFound = true; 313 } 314 } else { 315 jvmFound = true; 316 } 317 } 318 } 319 if ( verbose ) { if( jvmFound ) cout << "yes" << endl; else cout << "no" << endl; } 320 } 321 302 322 if ( !jvmFound ) { 303 323 -
release-kits/shared/search4j/libsearch4j.h
r15897 r17302 53 53 54 54 55 bool find( Jvm &jvm, bool use_minimum, Jvm minimum, string hint, bool verbose );55 bool find( Jvm &jvm, bool use_minimum, Jvm minimum, string phint, string hint, bool verbose ); -
release-kits/shared/search4j/search4j.cpp
r15892 r17302 45 45 46 46 bool verbose = false; 47 string phint = ""; 47 48 string hint = ""; 48 49 bool use_minimum = false; … … 94 95 } 95 96 97 } else if ( strcmp(argv[i], "-p") == 0 ) { 98 if ( i == argc-1 ) { 99 usage(); 100 return -1; 101 } else { 102 phint = argv[++i]; 103 } 104 96 105 } else if ( strcmp(argv[i], "-h") == 0 ) { 97 106 if ( i == argc-1 ) { … … 120 129 //find java 121 130 Jvm foundJvm; 122 bool found = find( foundJvm, use_minimum, minimum, hint, verbose );131 bool found = find( foundJvm, use_minimum, minimum, phint, hint, verbose ); 123 132 124 133 //check if it was found … … 237 246 << "Global Options:" << endl 238 247 << " -m VERSION_STRING: (minimum) find a java of the given version or newer, or fail" << endl 248 << " -p LOCATION: (priority hint) first look for java in LOCATION (treated as a JAVA_HOME)" << endl 239 249 << " -h LOCATION: (hint) as a last resort look for java in LOCATION (treated as a JAVA_HOME)" << endl 240 250 << " -w: (windows) find and/or use the javaw.exe executable instead of java.exe (in windows only)" << endl
Note:
See TracChangeset
for help on using the changeset viewer.