Title: Import Jar file into eclipse fails - cannot be resolved to a type
Tags: eclipse;import;jar
Question: I imported some JARs successfully into my eclipse java project. I get "cannot be resolved to a type" error when I try to use the classes in those JAR files in my code.
Now I have to either use eclipse's auto help feature or type the import statements manually to kill the errors and use those classes.
How do i stop getting the errors and remove the need to import manually all the time.
Eclipse never asks me to import Java.Lang.String. So, how do i ensure that it does the same thing for any other class ?

Here is the accepted answer: You can use Eclipse shortcut CTRL+SHIFT+O to "organize imports" so Eclipse will add the import necessary automatically looking for the class needed into the classpath. It can save you time, it is faster than going one by one using Ctrl-Space shortcut on an unrecognized class.

Here is another answer: You don't.  You'll have to import them all, but you can do it per-package, rather than per-Class.
All classes in java.lang are automatically imported into every Java program.  Likewise with all classes in the same package as the class containing the main() function.  Other than that, you have to import each class.
Eclipse will probably offer to import an unrecognized class for you - try the Ctrl-Space shortcut on an unrecognized class.
Finally, it won't hurt to read this:  http://en.wikipedia.org/wiki/Java_package - you may already all this, but there it is just in case.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:06/26/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<eclipse><import><jar>', 'Title': 'Import Jar file into eclipse fails - cannot be resolved to a type', 'ViewCount': 3541, 'id': 11216626, 'user_AboutMe': '<p>Here to learn Java from the Core Java for the Impatient book and other resources.</p>\n', 'user_AccountId': 1595531.0, 'user_DisplayName': 'Java Impatient', 'user_Reputation': 159.0, 'user_Views': 100.0, 'user_id': 1477760.0}}