How to find what library a specific function/method is in..

How does one go about finding the location of a specific function/method?   In other words, how does one know what libraries to import?
LVL 1
HLRosenbergerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VenabiliCommented:
You find which class the method is into and then import this class...

Or do you mean how you find which jars you need? If so -depends on the types of library. For the public ones, I am kinda used to the ones that I use... and internet help on the rest. For private one, I just search inside of the jars to find where the class is.

Or do you ask about something else?
0
mrcoffee365Commented:
This can be a weirdly hard question to answer.  I often google for the missing class, because some kind soul has put the api on the Web somewhere.  In checking, I just found this tool:
http://www.jarfinder.com/

which worked well with the sample class I tried.

There is a jwhich utility which will tell you where your class is in a defined classpath.  That needs the command line set up with a classpath.  This Java World article talks about it:
http://www.javaworld.com/javaworld/javatips/jw-javatip105.html
0
HLRosenbergerAuthor Commented:
mrcoffee365:

You have understood my question.  And, that's what I do - google it!  But that's a pain, and not a real good solution.  It seems to me that there should be something built into the IDE.
0
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

HLRosenbergerAuthor Commented:
Can a NetBeans expert tell me if this kind of functionality is built into the IE?  

For example, suppose I want to use JOptionPane.   Seems to me that the IDE should be able to tell me that I have to  import  javax.swing.JOptionPane.

Otherwise, I have to google it or otherwise know what to import.
0
VenabiliCommented:
Hold on - are you talking about classes or about finding which jar file the class is into?
0
mrcoffee365Commented:
All the IDEs will tell you that you have to import javax.swing.JOptionPane.  So NetBeans should tell you that, and Eclipse does.  What they can't tell you is the name of the jar.  Unless you have already added the jar to the project classpath.

So I use jwhich or google to find a jar if I can't figure it out on my own.
0
VenabiliCommented:
If it is just for the imports (as long as the library is already in the classpath):
Ctrl-Shift-I is fixing your imports
And I believe that if you use auto-complete, the classes should be imported automatically...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HLRosenbergerAuthor Commented:
Ctrl-Shift-I.

That's exactly the type of thing I'm looking for!  Thanks!
0
VenabiliCommented:
JUst copying the grading comment as it is not visible for everyone:
Author Comments:
Ctrl-Shift-I.

That's exactly the type of thing I'm looking for! Thanks!
======end of grading comment=====

You are welcome  :)  If you are not familiar with the shortcuts http://netbeanside61.blogspot.com/2008/04/top-10-netbeans-ide-keyboard-shortcuts.html has a list of the most useful ones :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.