Java class finder Tool

倾然丶 夕夏残阳落幕 提交于 2019-12-05 05:07:35

If you are using eclipse, then IBM's classfinder may be useful. You can perform a (fuzzy) search for a class in a (set of) directories, and get all jar that contains such a class.

Not sure about the classpath option, however.

regards,
Guillaume

If you use Bash this script may be helpful:

find . -name *.jar -exec bash -c "echo {} && jar tvf {} | grep MyClass" \;

You can use jarbrowser for this

If you're using Eclipse, and they're on your classpath, you can CapitalCaseControlSpace what you want.

For example, if I want to get a new ApacheFanUtilityMethodizerFunctor (which everyone needs, of course) I simply type AFUMF and then Ctrl+Space and it populates it for me. Since it's already on my classpath, I don't need to hunt for it, because it's there.

Now, if it wasn't on my classpath, and I had to find what jar it was in for purposes of including it, then back to WinRAR (or for me, Google typically) I go.

My own solution for managing java jars files and java classpath is really simple. Firstly I create folder inside e.g.:

C:\Program Files\Java\libraries\

Here I put all my *.jar files which i need to use. Then I modify the:

PATH(modyfy also CLASSPATH or JAVA_HOME) 

system variable and add this path shown above.

Problem occurs when one class is in two diffrent jars but I managed my jar to avoid this problem.

Now when java is running jvm can find my classes and ClassNoFoundException isn't thrown.

A late response, but in case anyone searching has a similar problem, I wrote a simple tool a few years back that I use all the time for this sort of problem.

It's free to use and open source. If you find it useful, let me know, :-)

https://github.com/eurozulu/Findclass

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!