Running Command Line


As shown in Figure 13-2, running the command line with no arguments results in the display of the help text, generated by the options passed to CLI.

Figure 13-2. Running without arguments.


Passing in a single -s java.lang.String argument, as shown in Figure 13-3, searches the default system class path. As can be seen, the class can be found in the rt.jar file supplied with the JRE.

Figure 13-3. A simple search.


As shown in Figure 13-4, a more complex search can be performed by passing -s org.apache.commons.lang.StringUtils -p C:\devenv\ -r 6 as an argument. This searches for all instances of org.apache.commons.lang.StringUtils in the C:\devenv\ directory, with a maximum recursion depth of 6. As can be seen, a number of instances of the Lang library were found on my system. Some of these explicitly contain a reference to the version of the library; several do not. It's easy to imagine running this utility to search the installation of an application server to troubleshoot class path problems.

Figure 13-4. A complex search.




    Apache Jakarta Commons(c) Reusable Java Components
    Real World Web Services
    ISBN: N/A
    EAN: 2147483647
    Year: 2006
    Pages: 137
    Authors: Will Iverson

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net