Inside Eclipse IDE, how can I show the list of types that exist in the jar?

I'm rediscovering Java and I'm a bit lost on how to do this in Eclipse. I look like an option for the Visual Studio "object browser" functionality, but I would settle for a quick list of the types that are defined in my external jar files that are referenced.

+1


a source to share


5 answers


Add the jar to the project build path (right click menu) It will look like a drawer (glass) with an arrow to open it as if it were a directory. Now open it, you will see its contents - packages containing classes.



But I advise you to search for javadocs first. Who needs this list of classes when you have javadoc!

+2


a source


The package explorer allows you to view the contents of your project files as objects, as soon as you extend the package you will see classes that you can extend the class to see its methods.

Likewise, projects have a Reference Libraries section that will expand to reflect the banks that the project depends on and thus allow viewing of their packages / classes / methods.



When looking at a class / interface, you can press F4 (or use the right-click menu) to see it in the type hierarchy.

+2


a source


Cntrl+Shift+T

will list all your types in all .jars links

+2


a source


One way is to simply expand the jar file (as if it were a directory) which will show its contents.

I don't know of any way to show only a list of types in a single jar file.

+1


a source


The correct way to do it is:

First import the Jar into your project build path using Project Properties ...

Then open the Java Viewer perspective.

Click on the Jar you want to view in the projects view.

Click on each package in the package view - the types will be displayed as types.

Quick tip: CTRL + SHIFT + T (Open Type ...) will allow you to open types for anything that Eclipse recognizes as a Java type, regardless of location (it might be in a jar). CTRL + SHIFT + R (Open Resource ...) won't, however - only open resources in your current project, so if you access local classes, you won't be able to open anything that's in the jar.

0


a source







All Articles