Hi,
At work, I see a number of Java files that do not have the 'import'
statements (such as "import org.apache.commons.lang.StringUtils") and so
Eclipse IDE 3.1 gives context-sensitive error message like 'StringUtils
cannot be resolved on lines where StringUtils are implemented. Is there a
way (to set up the classpath?add jar files? create user library?) in Eclipse
IDE to reference the jar files (commons-lang-2.1.jar, for example) so that
the import statements are not needed? Could someone show me how? Thank you.
jagonzal@gmail.com - 28 Jul 2006 22:25 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> IDE to reference the jar files (commons-lang-2.1.jar, for example) so that
> the import statements are not needed? Could someone show me how? Thank you.
You could get rid of the imports if you use the FQN of every external
class in your code. Imports are cleaner.
The problem you describe is fixed by opening the project properties,
going to "Java Build Path", and selecting the "Libraries" tab. There
you can add your external jars, and the imports will actually work.