Error:java.lang.UnsatisfiedLinkError:no NTVINV in Java.library.path

Source: Internet
Author: User

Error Message

When compiling or executing a Java application This 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 is 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 is 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 sections below for additional information.

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

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

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;Ten  Public classenginehelloworld{ One      Public Static voidMain (string[] args) { A         Try{ -             //Step 1:initialize The Java componet Object Model (COM) Interop. - engineinitializer.initializeengine (); the  -             //Step 2:initialize an ArcGIS license. -Aoinitialize Aoinit =Newaoinitialize (); - initializearcgislicenses (aoinit); +  -             //Step 3:invoke ArcObjects. +MapServer MapServer =NewMapServer (); A  atString Devkitinstalldir = system.getenv ("Agsdesktopjava"); -  -Mapserver.connect (Devkitinstalldir + -"/maptemplates/traditional Layouts/world/europe.mxd"); -  -String name =mapserver.getdefaultmapname (); in  -System.out.println ("Hello, arcobjects!:" +name); to  +             //Step 4:release the license. - Aoinit.shutdown (); the         } *         Catch(IOException ex) { $ System.out.println (Ex.getmessage ());Panax NotoginsengSystem.out.println ("App failed.")); -         } the}//End of method Main. +  A     //License Initialization the     Static voidinitializearcgislicenses (aoinitialize aoinit) { +         Try{ -             if(aoinit.isproductcodeavailable $(esrilicenseproductcode.esrilicenseproductcodeengine) = = $ esrilicensestatus.esrilicenseavailable) { - aoinit.initialize - (esrilicenseproductcode.esrilicenseproductcodeengine); the             } -             Else if(aoinit.isproductcodeavailableWuyi(esrilicenseproductcode.esrilicenseproductcodebasic) = = the esrilicensestatus.esrilicenseavailable) { - aoinit.initialize (esrilicenseproductcode.esrilicenseproductcodebasic) Wu                     ; -             } About             Else{ $ System.err.println ( -"Engine Runtime or Desktop Basic license not initialized."); -System.err.println ("Exiting application."); -System.exit (-1); A             } +         } the         Catch(Exception e) { - e.printstacktrace (); $         } the}//End of Method Initializearcgislicenses the}//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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.