简体   繁体   中英

How do you import GeoTools into an existing project in Intellij IDEA?

I have an existing project that was not built using Maven, and I would like to import the GeoTools library.

From the GeoTools website, the startup guide for Intellij involves creating a Maven project and modifying the pom file. But my project already exists and isn't a Maven project so it doesn't have a pom file.

I tried downloading all of the jar files for GeoTools 18.3 from https://sourceforge.net/projects/geotools/files/GeoTools%2018%20Releases/18.3/ and placing them into my lib folder, but I was still unable to import from com.geotools.

I tried adding GeoTools using the "Download Library from Maven Repository" feature, but searching "GeoTools" results in over 100 results from non-official sources, so I am unsure if any of them are what I'm looking for.

How do I import GeoTools into my project?

GeoTools is a not for profit org so you need to import from org.geotools not com.geotools .

If you insist on not using Maven to manage your dependencies (and I don't recommend this approach) the you can tyr following the NetBeans instructions which should apply to intelliJ too. The trick is to remove 3 of the 4 epsg jars otherwise they fight.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM