ABSTRACT:
In the Eclipse environment,Import is searching for package(. class file) in the CLASSPATH path and the project directory,
If you wantan IM port third-party package , you need to Add the package's top-level path to CLASSPATH. However,
The CLASSPATH set by the system environment variable cannot be recognized by the Eclipse and will be reported unresolve errorbecause
The CLASSPATH of the project is rewritten by E Clipse and needs to be set by the GUI or the . CLASSPATH file.
1. File Preparation
. class file (. Jar also available)
Note: cannot be a . Java file
2. set the classpath variable for the project
Two methods:
- Through the GUI:
project->properties->JAva Build path->libraries->add External Class Folder
- Modify the . classpath file under the project file
Add classpathentry, kind set to "Lib",path set to the top-level path of p Ackage:
<classpathentry kind= "Lib" path= "C:/users/rogeret/workspace/tij4-class"/>
Add package to project Classpath in Eclipse Environment