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

标签:

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

335b83df261c422459d4afc29ba290e5.png

d1b641f023dd079c9e4a800b96607d9d.gif

1 packagecom.ys.test;2

3 //Example 1: Hello ArcObjects!

4 importjava.io.IOException;5 importcom.esri.arcgis.system.AoInitialize;6 importcom.esri.arcgis.system.EngineInitializer;7 importcom.esri.arcgis.system.esriLicenseProductCode;8 importcom.esri.arcgis.system.esriLicenseStatus;9 importcom.esri.arcgis.carto.MapServer;10 public classEngineHelloWorld{11 public static voidmain(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 = newAoInitialize();18 initializeArcGISLicenses(aoInit);19

20 //Step 3: Invoke ArcObjects.

21 MapServer mapServer = newMapServer();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 voidinitializeArcGISLicenses(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 initializeArcGISLicenses

67 } //End of class:EngineHelloWorld.

Hello World

20180110211832171294.png

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

标签:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值