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

 package com.ys.test;

 //Example 1: Hello ArcObjects!
import java.io.IOException;
import com.esri.arcgis.system.AoInitialize;
import com.esri.arcgis.system.EngineInitializer;
import com.esri.arcgis.system.esriLicenseProductCode;
import com.esri.arcgis.system.esriLicenseStatus;
import com.esri.arcgis.carto.MapServer;
public class EngineHelloWorld{
public static void main(String[] args){
try{
//Step 1: Initialize the Java Componet Object Model (COM) Interop.
EngineInitializer.initializeEngine(); //Step 2: Initialize an ArcGIS license.
AoInitialize aoInit = new AoInitialize();
initializeArcGISLicenses(aoInit); //Step 3: Invoke ArcObjects.
MapServer mapServer = new MapServer(); String DevKitInstallDir = System.getenv("AGSDESKTOPJAVA"); mapServer.connect(DevKitInstallDir +
"/MapTemplates/Traditional Layouts/World/Europe.mxd"); String name = mapServer.getDefaultMapName(); System.out.println("Hello, ArcObjects!: " + name); //Step 4: Release the license.
aoInit.shutdown();
}
catch (IOException ex){
System.out.println(ex.getMessage());
System.out.println("App failed.");
}
} //End of method main. //License initialization
static void initializeArcGISLicenses(AoInitialize aoInit){
try{
if (aoInit.isProductCodeAvailable
(esriLicenseProductCode.esriLicenseProductCodeEngine) ==
esriLicenseStatus.esriLicenseAvailable){
aoInit.initialize
(esriLicenseProductCode.esriLicenseProductCodeEngine);
}
else if (aoInit.isProductCodeAvailable
(esriLicenseProductCode.esriLicenseProductCodeBasic) ==
esriLicenseStatus.esriLicenseAvailable){
aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeBasic)
;
}
else{
System.err.println(
"Engine Runtime or Desktop Basic license not initialized.");
System.err.println("Exiting application.");
System.exit( - 1);
}
}
catch (Exception e){
e.printStackTrace();
}
} //End of method initializeArcGISLicenses
} //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

Error: java.lang.UnsatisfiedLinkError: no ntvinv in java.library.path的更多相关文章

  1. ubuntu 12.04 x86_64:java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons

    sy@sy-Aspire-:~$ .0_155965261/configuration/.log !SESSION -- ::39.595 ------------------------------ ...

  2. java.lang.UnsatisfiedLinkError: no XXX in java.library.path

    其中涉及的测试源码如下: For those who didn't install Javawith default settings, a systematic way for solving JN ...

  3. "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no freetype in java.library.path

    Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no freetype in java ...

  4. java.lang.NoClassDefFoundError: com.sap.conn.jco.JCo (initialization failure) java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path

    java.lang.NoClassDefFoundError: com.sap.conn.jco.JCo (initialization failure) at java.lang.J9VMInter ...

  5. Exception in thread "main" java.lang.UnsatisfiedLinkError: no awt in java.library.path:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: no awt in java.library.path: 这是 ...

  6. 异常:没有找到本地方法库,java.lang.UnsatisfiedLinkError: no trsbean in java.library.path

    1.问题描述 迁移环境中遇到这个问题 : Fri Apr 20 15:22:31 CST 2018, Exception:500004___-500004,没有找到本地方法库,java.lang.Un ...

  7. Exception from System.loadLibrary(smjavaagentapi) java.lang.UnsatisfiedLinkError: no smjavaagentapi in java.library.path

    可能原因: 缺少smjavaagentapi.jar文件或者libsjavaagentapi.so缺少相关的依赖包. 解决方法: 1. 检查sso的lib下面是否有smjavaagentapi.jar ...

  8. jni调用 java.lang.UnsatisfiedLinkError: no segmentor_jni in java.library.path

    改过 LD_LIBRARY_PATH 改过 /etc/ld.so.conf 参考这篇文章 http://blog.csdn.net/zjuylok/article/details/4152559 最后 ...

  9. java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path

    1.system32添加sapjco3.dll 2.tomcat bin下添加sapjco3.dll 3.项目中添加sapjco3.jar 包

随机推荐

  1. 边工作边刷题:70天一遍leetcode: day 84-1

    Verify preorder sequence of Binary Search Tree 要点:simulating preorder sequence: 根据preorder的特点,首先会一直向 ...

  2. css让浮动元素水平居中

    对于定宽的非浮动元素我们可以用 margin:0 auto; 进行水平居中. 对于不定宽的浮动元素我们也有一个常用的技巧解决它的水平居中问题.如下: HTML 代码: <div class=&q ...

  3. Unity-WIKI 之 AnimationToPNG

    组件功能 把3D角色的动画录制成PNG一帧一帧输出,这是一个件多么美好的事! 可能遇到问题 有可能当你新建完脚本时会出现下面的错误: `System.IO.File' does not contain ...

  4. [转] 腾讯云直播OBS推流教程

    from: http://www.jianshu.com/p/bf4066028882 腾讯云直播OBS推流教程 字数383 阅读55 评论3 喜欢0 1.安装OBS 进入obs 官网 : https ...

  5. JQuery demo

    <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title> ...

  6. 我为什么反对推荐新人编程C/C++语言入门?

    虽然我接触编程以及计算机时间比较早,但是正式打算转入程序员这个行当差不多是大学第四年的事情 从03年接触计算机,07年开始接触计算机编程, 期间接触过的技术包括 缓冲区溢出(看高手写的shellcod ...

  7. smarty中section遍历数组

    smarty中section遍历数组

  8. flex布局滑动页面

    html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...

  9. Gvim使用

    VIM删除空白行 命令:g/^\s*$/d :g 代表在全文档范围内 ^代表行的开始 \s*代表空白字符 &代表行的结束 d代表删除 用//将3段代码隔开

  10. 如何将NTFS格式的移动硬盘挂接到Mac OS上进行读写(Read/Write)操作

    现在硬盘便宜,很多同学都有移动硬盘,如果你同时使用Windows与Mac OS的话,移动硬盘最好不要使用NTFS文件系统,否则在Mac OS上,你只能读你的移动硬盘,不能写. 但是实际上的情况是,移动 ...