How to find the jar file containing a class definition ?
|
|
|
Sometimes you are looking for a class in an application server but don't know where this class is located. In Websphere common libraries have been repackaged by IBM using an in house naming convention.
Unix systems offers several useful commands to retrieve all files packaging a class without having to unzip all libraries.
The following snippet list the jar file containing the class " MyClass " :
If you want to write the resut in a file you can use the following command
Create a script
If you prefer to use a script you can define your own script to do the job
Create a shell script named findClass.sh
If you need more informations about special variables you can click the link.
You can then find your class in the current folder using the command
Tags: find , class , system , file , packaging , snippet , retrieve , list , posix