COMPILING - Linux, MacOS, and other brands of Unix
--------------------------------------------------
To compile the search4j executable and install it to /usr/local/search4j/bin, run

 ./configure
 make
 make install

Use --bindir option to ./configure to control where the executable gets placed at `make install'

COMPILING - Windows
-------------------
To compile the search4j.exe executable and install it to C:\Program Files\search4j\bin, run

 nmake /f win32.mak
 nmake /f win32.mak install

Append BINDIR="SomeOtherPath" to the above commands to control where the executable gets placed at install.

USING SEARCH4J
--------------
search4j has three modes: find(default), compare, and launch.

In 'find' mode, search4j searches for a java installation of the requested type and prints some information about it to stdout. By default, it prints the filesystem location of the java installation (i.e., it prints JAVA_HOME or JRE_HOME). The '-e' flag tells search4j to print the full path to the java executable (java or java.exe). The '-v' flag tells search4j to print the version number of the found java installation (E.g., 1.5.0_02). The '-t' flag tells search4j to print the type of the found java installation - whether JRE or JDK. Example command: "search4j -v".

In 'compare' mode, search4j takes a java version number as an argument. As in 'find' mode, search4j searches for a java installation of the requested type, and then compares the version number of the found java to the version number given as an argument, and reports whether the given version represents a newer, older, or equal version of java. Example command: "search4j -c 1.4.0_03".

In 'launch' mode, search4j takes the path of an executable jar file as an argument. It searches for a java installation of the requested type and then launches the given jar file with that installation of java. Example command: "search4j -l myjar.jar".

search4j has several options to control what kind of java installation it looks for:
The '-m VERSION_STRING' option tells search4j to only search for java installations equal to or newer than the given version.
The '-d' flag tells search4j to only search for JDK java installations.
The '-r' flag tells search4j to only search for JRE java installations.

search4j also takes hints about where java might be:
The '-p LOCATION' (priority hint) option gives search4j a location to look for java first, before executing the default logic for finding java.
The '-h LOCATION' option gives search4j a location to look for java as a last resort if the default logic for finding java fails.

In windows, you can use the '-w' flag to tell search4j to use the 'javaw.exe' java executable instead of the usual 'java.exe' exectable, which spawns a DOS console. This only affects launch mode and find mode with the '-e' flag.

The '--verbose' gives detailed information about what search4j is doing.
The '--help' option gives you the quick usage reference.

