Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine which jar file contain org.apache.lucene class file

Tags:

java

jar

lucene

I am working on a search engine for searching (site is Tutorial Documentation) links & words/phrases contained in Site . I have a code which use org.apache.lucene package. How do I determine which jar file contains this package (class file is org.apache.lucene.analysis.standard.StandardAnalyzer). I have downloaded lucene-4.8.0 zip file from Apache mirror site. But It does not contains following classes

   org.apache.lucene.analysis.standard.StandardAnalyzer
   org.apache.lucene.queryParser.QueryParser
   org.apache.lucene.search.Searcher;

My question How do I determine which jar file contains this package (containing all class files). Any guidance for Download site is appreciated. I have searched net but of no avail.

like image 946
user3405312 Avatar asked May 09 '14 09:05

user3405312


People also ask

How do you check if a jar file has a class in it?

You can use Java jar tool. List the content of jar file in a txt file and you can see all the classes in the jar. You can also use unzip -l jarfile. jar in a pinch.

Which jar is my class loaded from?

Use –verbose:class flag with your java command line. This option enables loading and unloading of classes. It shows the jar file from which the class is loaded.

How do I see files in a jar in Linux?

Using the unzip Command The unzip command is a commonly used utility for working with ZIP files from the Linux command-line. Thanks to the unzip command, we can view the content of a JAR file without the JDK. The output above is pretty clear. It lists the files in the JAR file in a tabular format.


1 Answers

You can use Maven search: opt for advanced search and paste the class name. Then from the search results, pick the relevant version (4.8.0 in your case); this will show you the jar.

You can also search for both version and class name. Use v for version and fc for class name, e.g. the full query would look like as follows:

v:"4.8.0" fc:"org.apache.lucene.analysis.standard.StandardAnalyzer"

like image 133
mindas Avatar answered Sep 24 '22 15:09

mindas