因为项目需要使用Gis地图,一直学java的,于是找到了geotools,更新还很频繁,那就用他吧,下载了最新版的geotools-23.4-bin,netbeans开发起来,导入java包,按照官网文档Quickstart代码抄过来,期待出界面但是报了一堆错:
//si-units-Java8-7.0.1.jar
//Exception in thread "main" java.lang.NoClassDefFoundError: si/uom/SI
?
//indriya-2.1.1.jar
//Exception in thread "main" java.lang.NoClassDefFoundError: tech/units/indriya/unit/Units
?
//unit-api-1.0.jar
//Exception in thread "main" java.lang.NoClassDefFoundError: javax/measure/spi/SystemOfUnits
?
//uom-lib-common-1.0.2.jar
//Exception in thread "main" java.lang.NoClassDefFoundError: tech/uom/lib/common/function/Nameable
?
//uom-se-1.0.8.jar
//Exception in thread "main" java.lang.NoClassDefFoundError: tec/uom/se/AbstractSystemOfUnits
?
费了好几天时间找了各种版本的jar包,最终如上对应的jar导入后终于可以看到地图界面了。
?
但是还有很多其他错误:
警告: Can't load a service for category "RasterProcess". Cause is "ServiceConfigurationError: org.geotools.process.raster.RasterProcess: Provider org.geotools.process.raster.JiffleProcess could not be instantiated".
java.util.ServiceConfigurationError: org.geotools.process.raster.RasterProcess: Provider org.geotools.process.raster.JiffleProcess could not be instantiated
Caused by: java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI
网上查了需要安装JAI运行时环境。暂时不安装了,后面再说吧。
?