Skip to content
rh1247 edited this page May 25, 2011 · 8 revisions

Utility for searching java class files in the classpath

Installation

% mkdir <jwhich_dir>
  • unpack the jwhich.zip file in <jwhich_dir>
% cd <jwhich_dir>
% unzip <download_dir>/jwhich_src-1.01.zip
  • Create a symbolic link to jwhich_dir/jwhich:
% ln -s <jwhich_dir>/jwhich /usr/bin/jwhich
  • Make jwhich script executable
% chmod 755 <jwhich_dir>/jwhich

Usage

jwhich [options] <class_name_pattern> [<search_path>]

 Search a class in directories, zip or jar files

   <class_name_pattern>  pattern for a class name in glob style (* and ? wild cards)
   <search_path>          One or more directories, zip or jar files
                          if no search path is specified the working directory is used

Options:

   --verbose|-v            verbose mode.
   --ignore-case|-i        case insensitive matching of classnames
   --help|-h               print this usage
Examples:
   jwhich 'java.lang.*' $JAVA_HOME/lib/rt.jar

Start jwhich with

% jwhich

Compiling

You need JDK 6 and ant 1.7.1. Download it from

Download the source zip file from https://github.com/rh1247/jwhich/blob/master/releases/jwhich_src-1.01.zip

Unpack the source zip file and call ant

% unzip jwhich-1.01.zip
% cd jwhich-1.01
% ant