classfind
Allows mapping between Java class names, packages, and their location in the classpath
Uses include:
- analysing
classpath
anomalies - generating
import
statements, help urls etc. in editors classpath
completion using zsh
Version 1.1 - release 10-Apr-2004
classfind is released under the GPL license. Right-click and choose Save As if your browser doesn't offer you the option.
classfind.jar - the .jar file to use
classfind.tar.gz - the source code and scripts
Usageclassfind is designed to be invoked from editors, shell completions etc. Consequently you'll want to wrap it in a script, such as:
#!/bin/sh
java -jar classfind.jar $*
classfind
operates by analysing the environment's CLASSPATH
, and building a mapping of classes vs. their packages and their location in the CLASSPATH
. This mapping is stored in a file called .classfind
, located (unless specified otherwise) in your home directory.
classfind
options:
- -h : displays help
- -r : rebuilds the cache
- -d : disables duplicate package display
- -c [class] : finds the given class
- -v [class] : generates the complete package name for the given class
- -f [file] : the classfind cache file to use
- -p [pkg] : the package to expand from
example% classfind -c Document /usr/java/j2sdk1.4.0/jre/lib/rt.jar -> org.w3c.dom.Document /usr/java/j2sdk1.4.0/jre/lib/rt.jar -> javax.swing.text.Documenthighlights that you can access a Java
Document
object from two packages, both from within the same .jar
file.
Other uses for classfind
- Generating
import
statements and generating Javadoc help urls from within editors. vim configurations available on request. - Zsh command line completion. Works in a similar way to filename completion. Insert the following in your
.zshrc
function classpaths { reply=(`classfind -p $1 $2 2>/dev/null`) } compctl -S "" -X "Completing with %n Java class(es)" -K classpaths java
to allow TAB completion of classes when using the java command
classfind is written and maintained by OOPS Consultancy Ltd. Enquiries to classfind@oopsconsultancy.com.
Hosted on
Copyright © 1997-2005 OOPS Consultancy Ltd