博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Error: java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path
阅读量:6484 次
发布时间:2019-06-23

本文共 3909 字,大约阅读时间需要 13 分钟。

 

 

Error Message

When compiling or executing a Java application that uses the ArcObjects Java API, the following error is returned:

java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path

Cause

The PATH variable does not include a directory which contains the native libraries required for ArcObjects Java classes to function.

Solution or Workaround

Add the directory that contains the native libraries needed by ArcObjects Java to the PATH variable.

  • On both Windows and Unix platforms, add either of the following directories to the PATH variable:
    A. $AGSDESKTOPJAVA\java\jre\bin
    B. $AGSDESKTOPJAVA\bin
    Note: $ARCENGINEHOME may need to be replaced with the location of the ArcGIS SDK installation.
  • Unix also provides the option of running the ArcEngine helper scripts in $ARCENGINEHOME: init_engine.csh or init_engine.sh.
  • See ArcGIS SDK for Java Environment Settings in the Related Information section below for additional information.

 

 

 

On Windows, you must modify your PATH system variable to include either:

 

%AGSDESKTOPJAVA%\java\jre\bin %AGSDESKTOPJAVA%\bin

1 package com.ys.test; 2  3 //Example 1: Hello ArcObjects! 4 import java.io.IOException; 5 import com.esri.arcgis.system.AoInitialize; 6 import com.esri.arcgis.system.EngineInitializer; 7 import com.esri.arcgis.system.esriLicenseProductCode; 8 import com.esri.arcgis.system.esriLicenseStatus; 9 import com.esri.arcgis.carto.MapServer;10 public class EngineHelloWorld{11     public static void main(String[] args){12         try{13             //Step 1: Initialize the Java Componet Object Model (COM) Interop.14             EngineInitializer.initializeEngine();15 16             //Step 2: Initialize an ArcGIS license.17             AoInitialize aoInit = new AoInitialize();18             initializeArcGISLicenses(aoInit);19 20             //Step 3: Invoke ArcObjects.21             MapServer mapServer = new MapServer();22 23             String DevKitInstallDir = System.getenv("AGSDESKTOPJAVA");24 25             mapServer.connect(DevKitInstallDir + 26                 "/MapTemplates/Traditional Layouts/World/Europe.mxd");27 28             String name = mapServer.getDefaultMapName();29 30             System.out.println("Hello, ArcObjects!: " + name);31 32             //Step 4: Release the license.33             aoInit.shutdown();34         }35         catch (IOException ex){36             System.out.println(ex.getMessage());37             System.out.println("App failed.");38         }39     } //End of method main.40 41     //License initialization 42     static void initializeArcGISLicenses(AoInitialize aoInit){43         try{44             if (aoInit.isProductCodeAvailable45                 (esriLicenseProductCode.esriLicenseProductCodeEngine) ==46                 esriLicenseStatus.esriLicenseAvailable){47                 aoInit.initialize48                     (esriLicenseProductCode.esriLicenseProductCodeEngine);49             }50             else if (aoInit.isProductCodeAvailable51                 (esriLicenseProductCode.esriLicenseProductCodeBasic) ==52                 esriLicenseStatus.esriLicenseAvailable){53                 aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeBasic)54                     ;55             }56             else{57                 System.err.println(58                     "Engine Runtime or Desktop Basic license not initialized.");59                 System.err.println("Exiting application.");60                 System.exit( - 1);61             }62         }63         catch (Exception e){64             e.printStackTrace();65         }66     } //End of method initializeArcGISLicenses67 } //End of class:EngineHelloWorld.
Hello World

 

 

http://desktop.arcgis.com/en/arcobjects/latest/java/

http://support.esri.com/technical-article/000007942

http://edndoc.esri.com/arcobjects/9.1/default.asp?URL=/arcobjects/9.1/ArcGISDevHelp/DevelopmentEnvs/Java/JavaArcGISProgramming.htm

转载地址:http://mriuo.baihongyu.com/

你可能感兴趣的文章
Android进程间通信(IPC)机制Binder简要介绍和学习计划
查看>>
在git@osc上托管自己的代码
查看>>
Training的第五天
查看>>
软件架构师的职责范围谈
查看>>
计算思维与创新创业 课程 获批
查看>>
yum install 时遇到 HTTP 404 page not found错误
查看>>
细说五层网站架构
查看>>
搭建ubuntu环境
查看>>
Xen命令全集
查看>>
水环境指标 中文对照
查看>>
YUM
查看>>
Web App和Native App 谁将是未来
查看>>
Git 常用命令整理
查看>>
hive 导入数据表乱码
查看>>
Java 多线程 之 Thread
查看>>
配置管理小报100330:为什么配置库中代码和文档分开放?
查看>>
JSP指令元素:page指令,include指令,taglib指令
查看>>
java 自动装箱和拆箱
查看>>
NTFS的五大热点问题解答
查看>>
下丁字符号用MathType怎么编辑出来
查看>>