Java is an open-source world, how to quickly search for the Java source you need it? July 17, 2009, the Grepcode team released an interesting Java source search engine-grepcode. Compared with the various search engines available, Java source search engine-grepcode the Java source to a new level. Java source search engine-grepcode not only provides syntax highlighting and javadoc the reality, but also provides a very friendly interface Java Type Integration view, easy for people to search. Users can easily find the engineering code that a particular version of the code relies on. Java source search engine-grepcode also allows users to navigate directly to the calling Java method body from a call to a Java method. Stack trace Search is another highlight of Java source search engine-grepcode, which allows programmers to quickly locate an exception corresponding to the code, without the need to download the entire functionality of the source package or a third-party source code package. The author uses the Java source search engine searches "Tapestry" returns the result is two columns: Types and Projects, in which types returns the result is tapestry each version the interface and the class definition list, and projects returns the result is tapestry each version of the package name, visible Java source search engine-grepcode return results are very clear humanization, is the developer's first choice to consult the source code!
Java source search Engine-grepcode website:
Http://grepcode.com
The GC plugin for Eclipse, like any other eclipse plug-in, can be installed in the following steps:
- Help, Install new software.
- Click the "Add ..." button and enter the update URL for name and Grepcode http://repository.grepcode.com/java/ext-eclipse/
- Click on the "Next" button to enter the "Install Details" page
- Accept the license description and click on the "Finish" button.
Usage
After the GC plug-in was successfully installed in eclipse in the previous step, we can use it to browse the source code in the open source repository used in our codes, as illustrated below:
- Suppose you are on a project that involves an open source library, such as jgroups. Your project is registered as a jgroups-all.jar of its dependencies (i.e., assuming that a class in your project is used in the open source repository of jgroups), as shown below.
- The "Jchannel" class in the JGroups class library used in the "Jgroupstest" project. In the "Jchannel" class we press the F3 key to see "Jchannel" class source code, we will find "class File Editor" Prompt "no source", we can only browse to "Jchannel" part of the description, not what we want to see " The source code for the Jchannel class.
- Although we do not see the "Jchannel" source code in the "Class File Editor" view, we can search the "Jchannel" class in Grepcode by clicking the "GC Search" button on the tools panel and using the GC plugin. The search results are displayed in the GC Search tab in the IDE.
- Now we can choose the source version corresponding to our project to view the source code of the "Jchannel" class.
- We can also use the shortcut key "Ctrl+m" to maximize the "Class File Editor" window to facilitate us to read the source code.
[Eclipse Plugin] How to install and use the Grepcode plugin in eclipse