Java: How do I know which jar file to use given a class name?

前端 未结 17 1325
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-02 09:47

Given a class, org.eclipse.ui.views.navigator.ResourceNavigator for example, how do I find out which jar file to use? I know it\'s in org.eclipse.ui.ide, but how would I fin

17条回答
  •  生来不讨喜
    2020-12-02 09:54

    You also have this eclipse plugin: jarclassfinder

    The user enters the name of the class not found (or the name of the class that the Java project needs to access). The plug-in will search the selected directory (and subdirectories) for JAR files containing that class.

    All results are displayed in a table in a custom view. The user can then browse this table and select the JAR file to add to his Java project's build path. The user then right-clicks on the entry in the table and, from the context menu, selects the build path to which to add it.


    Update 2013, as I mention in "searching through .jar files eclipse", it is no longer maintained, and the alternatives are sparse.

    As sunleo comments below:

    with Eclipse, Ctfl+Shift+T remains the easiest alternative to look for a type
    (with the jar name displayed in the status bar).


    user862268 comments below:

    For mac, it is cmd+shift+T in Eclipse to find the class and associated jar.

提交回复
热议问题