Because geotools was originally built using Maven, you cannot directly import the project to eclipse for compilation. To build geotools using eclipse, perform the following operations:
1. Download and install maven2 at http://maven.apache.org/. configure the maven_homeenvironment variable and configure the bindirectory to the pathenvironment variable.
2. Switch to the geotools main directory and execute the following command: MVN install (this step is to download the public library file). The steps are as follows:
3. Run the following command in the geotools main directory: MVN Eclipse: eclipse to generate the Eclipse project file.
4. Install the Eclipse plug-in of maven2. The address isHttp://m2eclipse.sonatype.org/sites/m2e,
5. Configure the classpath variable m2_repo in eclipse, pointing to % homedrive % homepath %/. m2/Repository (this is the public library file downloaded by Maven ).
6. Import the converted geotools project to eclipse.
The detailed steps for installing maven2 are as follows:
1) download the maven-2.0.x.tar.gzpackage from http://maven.apache.org/download.html.
Go to the directory you downloaded and decompress the package. In Linux, decompress the package with tar. As follows:
Tar zxvf maven-2.0.tar.gz or unzip maven-2.0.zip
2) The "maven-2.0.x" Directory will be created
3) Add the bin directory to your system path (assuming the decompressed directory is/usr/local) as follows:
Export Path =/usr/local/maven-2.0.x/bin: $ path or set Path = "C: \ Program Files \ maven-2.0.x \ bin"; % PATH %
4) Confirm that the java_home environment variable has been set
5) Run "MVN -- version". if the version is displayed, the installation is successful.
Reprinted from: http://hi.baidu.com/hantati/blog/item/555d4f50e43ff16e84352414.html