• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

no nitf.jni-c in java.library.path

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have java program on Window SP and eclipse IDE, have set VM arguments: -Djava.library.path=$PATH_TO_JNI_DLL_DIR, and set the environment path pointing
to where the nitf.jni-c.dll is located.

I got the errors as below, please help. Thanks

Exception in thread "main" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kee Kee moon wrote:Exception in thread "main" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path


Well plainly something isn't getting through. I suspect it'll be that $PATH_TO_JNI_DLL_DIR isn't being understood properly, but without more specifics, it's very difficult to guess.

What does the actual error message say? Also, described in more detail ALL the steps you took to define these things.

Winston
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Winston Gutkowski wrote:

Kee Kee moon wrote:Exception in thread "main" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path


Well plainly something isn't getting through. I suspect it'll be that $PATH_TO_JNI_DLL_DIR isn't being understood properly, but without more specifics, it's very difficult to guess.

What does the actual error message say? Also, described in more detail ALL the steps you took to define these things.

Winston



This is the errors:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)


I did set environment PATH_TO_JNI_DLL_DIR point to C:\Program Files\nitro-nitf\nitro-2.6\lib
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kee Kee moon wrote:Exception in thread "main" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path
...
I did set environment PATH_TO_JNI_DLL_DIR point to C:\Program Files\nitro-nitf\nitro-2.6\lib


Fraid I can't be of much more use, but it seems to me that java.library.path is the operative bit there. You could try the Eclipse help pages, or this thread might help.

Winston
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Winston Gutkowski wrote:

Kee Kee moon wrote:Exception in thread "main" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path
...
I did set environment PATH_TO_JNI_DLL_DIR point to C:\Program Files\nitro-nitf\nitro-2.6\lib


Fraid I can't be of much more use, but it seems to me that java.library.path is the operative bit there. You could try the Eclipse help pages, or this thread might help.

Winston



Thank you anyway.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you running this on Windows or on Linux (or another Unix-like OS)?

On Linux, you would refer to an environment variable with a $ and the name, like $PATH_TO_JNI_DLL_DIR as you have in your example.

On Windows, it's %name%, for example %PATH_TO_JNI_DLL_DIR%

Since you're talking about a DLL, you're probably running it on Windows. So, try -Djava.library.path=%PATH_TO_JNI_DLL_DIR% instead of -Djava.library.path=$PATH_TO_JNI_DLL_DIR

(Ofcourse, you'll have to set the environment variable PATH_TO_JNI_DLL_DIR to the directory that contains the DLL).
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesper de Jong wrote:Are you running this on Windows or on Linux (or another Unix-like OS)?

On Linux, you would refer to an environment variable with a $ and the name, like $PATH_TO_JNI_DLL_DIR as you have in your example.

On Windows, it's %name%, for example %PATH_TO_JNI_DLL_DIR%

Since you're talking about a DLL, you're probably running it on Windows. So, try -Djava.library.path=%PATH_TO_JNI_DLL_DIR% instead of -Djava.library.path=$PATH_TO_JNI_DLL_DIR

(Ofcourse, you'll have to set the environment variable PATH_TO_JNI_DLL_DIR to the directory that contains the DLL).




I run the java program on XP 32 bits, use eclipse IDE.
I finally got the environment correctly, unfortunately I got errors as below. I have un-install and re-install the new version of 7.0_06-b24, got the same
error "EXCEPTION_ACCESS_VIOLATION", see below.

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6e8027ff, pid=3692, tid=388
#
# JRE version: 7.0_06-b24
# Java VM: Java HotSpot(TM) Client VM (23.2-b09 mixed mode, sharing windows-x86 )
# Problematic frame:
# V [jvm.dll+0xb27ff]
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kee Kee moon wrote:

Jesper de Jong wrote:Are you running this on Windows or on Linux (or another Unix-like OS)?

On Linux, you would refer to an environment variable with a $ and the name, like $PATH_TO_JNI_DLL_DIR as you have in your example.

On Windows, it's %name%, for example %PATH_TO_JNI_DLL_DIR%

Since you're talking about a DLL, you're probably running it on Windows. So, try -Djava.library.path=%PATH_TO_JNI_DLL_DIR% instead of -Djava.library.path=$PATH_TO_JNI_DLL_DIR

(Ofcourse, you'll have to set the environment variable PATH_TO_JNI_DLL_DIR to the directory that contains the DLL).




I run the java program on XP 32 bits, use eclipse IDE.
I finally got the environment correctly, unfortunately I got errors as below. I have un-install and re-install the new version of 7.0_06-b24, got the same
error "EXCEPTION_ACCESS_VIOLATION", see below.

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6e8027ff, pid=3692, tid=388
#
# JRE version: 7.0_06-b24
# Java VM: Java HotSpot(TM) Client VM (23.2-b09 mixed mode, sharing windows-x86 )
# Problematic frame:
# V [jvm.dll+0xb27ff]





I should have posted the following message in my previously one.

--------------- T H R E A D ---------------

Current thread (0x003da800): JavaThread "main" [_thread_in_vm, id=388, stack(0x00a00000,0x00a50000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x00000000, EBX=0x00000000, ECX=0x003da800, EDX=0x6e9dc450
ESP=0x00a4f54c, EBP=0x00a4f594, ESI=0x003da800, EDI=0x003da928
EIP=0x6e8027ff, EFLAGS=0x00010246

Top of Stack: (sp=0x00a4f54c)
0x00a4f54c: 02b80aa4 003da928 02b80aa8 02b80aa4
0x00a4f55c: 003da800 02b80aa8 00a4f554 73001ccb
0x00a4f56c: 00a4fde8 6e9bcc5e 0000000e fffffffe
0x00a4f57c: 00a4f59c 6e7fa44f 003da800 003db074
0x00a4f58c: 0000065f 6e9dc450 02b80a9c 10007d9c
0x00a4f59c: 003da928 02b80aa8 00000000 00000000
0x00a4f5ac: 00000000 00000001 031e5b90 003da928
0x00a4f5bc: 00000000 10009e66 003da928 00000000

Instructions: (pc=0x6e8027ff)
0x6e8027df: 83 c4 08 89 75 f0 89 5d f4 39 5e 04 74 08 8d 4d
0x6e8027ef: f0 e8 5b a9 0b 00 8b 45 10 c7 45 e0 0e 00 00 00
0x6e8027ff: 8b 08 e8 fa 82 f5 ff 50 8d 4d c4 e8 71 d9 08 00
0x6e80280f: 8b 45 10 56 8d 55 c4 52 8d 4d 14 50 89 4d dc 8b


Register to memory mapping:

EAX=0x00000000 is an unknown value
EBX=0x00000000 is an unknown value
ECX=0x003da800 is a thread
EDX=0x6e9dc450 is an unknown value
ESP=0x00a4f54c is pointing into the stack for thread: 0x003da800
EBP=0x00a4f594 is pointing into the stack for thread: 0x003da800
ESI=0x003da800 is a thread
EDI=0x003da928 is an unknown value


Stack: [0x00a00000,0x00a50000], sp=0x00a4f54c, free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0xb27ff]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j nitf.Reader.read(Lnitf/IOHandle;)Lnitf/Record;+0
j nitf.imageio.NITFReader.readHeader()V+61
j nitf.imageio.NITFReader.getRecord()Lnitf/Record;+10
j testing.ShowImages.main([Ljava/lang/String;)V+475
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x02b9f400 JavaThread "Service Thread" daemon [_thread_blocked, id=2804, stack(0x02f30000,0x02f80000)]
0x02b9c000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=2652, stack(0x02ee0000,0x02f30000)]
0x02b97c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=1876, stack(0x02e90000,0x02ee0000)]
0x02b96400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1144, stack(0x02e40000,0x02e90000)]
0x02b86000 JavaThread "Finalizer" daemon [_thread_blocked, id=708, stack(0x02df0000,0x02e40000)]
0x02b81000 JavaThread "Reference Handler" daemon [_thread_blocked, id=2864, stack(0x02da0000,0x02df0000)]
=>0x003da800 JavaThread "main" [_thread_in_vm, id=388, stack(0x00a00000,0x00a50000)]

Other Threads:
0x02b7f800 VMThread [stack: 0x02d50000,0x02da0000] [id=3776]
0x02bb1c00 WatcherThread [stack: 0x02f80000,0x02fd0000] [id=2036]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 4928K, used 2430K [0x22c00000, 0x23150000, 0x28150000)
eden space 4416K, 55% used [0x22c00000, 0x22e5f988, 0x23050000)
from space 512K, 0% used [0x23050000, 0x23050000, 0x230d0000)
to space 512K, 0% used [0x230d0000, 0x230d0000, 0x23150000)
tenured generation total 10944K, used 0K [0x28150000, 0x28c00000, 0x32c00000)
the space 10944K, 0% used [0x28150000, 0x28150000, 0x28150200, 0x28c00000)
compacting perm gen total 12288K, used 1022K [0x32c00000, 0x33800000, 0x36c00000)
the space 12288K, 8% used [0x32c00000, 0x32cffac8, 0x32cffc00, 0x33800000)
ro space 10240K, 42% used [0x36c00000, 0x3703f4a0, 0x3703f600, 0x37600000)
rw space 12288K, 54% used [0x37600000, 0x37c7fc80, 0x37c7fe00, 0x38200000)

Card table byte_map: [0x02bf0000,0x02ca0000] byte_map_base: 0x02ada000

Polling page: 0x003f0000

Code Cache [0x00a70000, 0x00b28000, 0x02a70000)
total_blobs=224 nmethods=74 adapters=85 free_code_cache=32045Kb largest_free_block=32814144

Compilation events (10 events):
Event: 0.256 Thread 0x02b9c000 69 java.math.BigInteger::primitiveLeftShift (79 bytes)
Event: 0.257 Thread 0x02b9c000 nmethod 69 0x00b22f88 code [0x00b23090, 0x00b23200]
Event: 0.259 Thread 0x02b9c000 70 java.lang.String::getChars (62 bytes)
Event: 0.259 Thread 0x02b9c000 nmethod 70 0x00b23388 code [0x00b234c0, 0x00b23750]
Event: 0.261 Thread 0x02b9c000 71 java.util.HashMap::getEntry (77 bytes)
Event: 0.261 Thread 0x02b9c000 nmethod 71 0x00b23948 code [0x00b23a60, 0x00b23bd8]
Event: 0.268 Thread 0x02b9c000 73 java.lang.AbstractStringBuilder::append (48 bytes)
Event: 0.268 Thread 0x02b9c000 nmethod 73 0x00b24388 code [0x00b244a0, 0x00b245c8]
Event: 0.272 Thread 0x02b9c000 74 sun.misc.MetaIndex::mayContain (51 bytes)
Event: 0.272 Thread 0x02b9c000 nmethod 74 0x00b24708 code [0x00b24830, 0x00b249b8]

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (10 events):
Event: 0.275 Thread 0x003da800 Threw 0x22e45b48 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.276 Thread 0x003da800 Threw 0x22e47b70 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.276 Thread 0x003da800 Threw 0x22e49a28 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.278 Thread 0x003da800 Threw 0x22e4c088 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.281 Thread 0x003da800 Threw 0x22e4ed50 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.282 Thread 0x003da800 Threw 0x22e52a70 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.283 Thread 0x003da800 Threw 0x22e55270 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.284 Thread 0x003da800 Threw 0x22e56d60 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.285 Thread 0x003da800 Threw 0x22e5a190 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.285 Thread 0x003da800 Threw 0x22e5b410 at C:\jdk7u2_32P\jdk7u6\hotspot\src\share\vm\prims\jni.cpp:1631

Events (10 events):
Event: 0.281 loading class 0x0308d6d0
Event: 0.281 loading class 0x0308d6d0 done
Event: 0.282 loading class 0x0308eba8
Event: 0.282 loading class 0x0308eba8 done
Event: 0.283 loading class 0x03023c40
Event: 0.283 loading class 0x03023c40 done
Event: 0.284 loading class 0x02bc8058
Event: 0.284 loading class 0x02bc8058 done
Event: 0.284 loading class 0x0308cad0
Event: 0.284 loading class 0x0308cad0 done


Dynamic libraries:
0x00400000 - 0x0042f000 C:\Program Files\Java\jre7\bin\javaw.exe
0x7c900000 - 0x7c9b2000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f6000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f03000 C:\WINDOWS\system32\RPCRT4.dll
0x77fe0000 - 0x77ff1000 C:\WINDOWS\system32\Secur32.dll
0x7e410000 - 0x7e4a1000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f59000 C:\WINDOWS\system32\GDI32.dll
0x773d0000 - 0x774d3000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\COMCTL32.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\msvcrt.dll
0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL
0x629c0000 - 0x629c9000 C:\WINDOWS\system32\LPK.DLL
0x74d90000 - 0x74dfb000 C:\WINDOWS\system32\USP10.dll
0x78aa0000 - 0x78b5e000 C:\Program Files\Java\jre7\bin\msvcr100.dll
0x6e750000 - 0x6ea9c000 C:\Program Files\Java\jre7\bin\client\jvm.dll
0x71ad0000 - 0x71ad9000 C:\WINDOWS\system32\WSOCK32.dll
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x6e6a0000 - 0x6e6ac000 C:\Program Files\Java\jre7\bin\verify.dll
0x6d480000 - 0x6d4a0000 C:\Program Files\Java\jre7\bin\java.dll
0x6e730000 - 0x6e743000 C:\Program Files\Java\jre7\bin\zip.dll
0x10000000 - 0x1006d000 C:\Program Files\nitro-nitf\nitro-2.6\lib\nitf.jni-c.dll
0x59a60000 - 0x59b01000 C:\WINDOWS\system32\dbghelp.dll
0x77c00000 - 0x77c08000 C:\WINDOWS\system32\VERSION.dll
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it looks like now it load the DLL correctly, but then it crashes in the native code in the DLL. That happens probably because there's a bug in the DLL or because you are calling it with parameters that it can't deal with.
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesper de Jong wrote:So it looks like now it load the DLL correctly, but then it crashes in the native code in the DLL. That happens probably because there's a bug in the DLL or because you are calling it with parameters that it can't deal with.



do you think because of the service pack, I have service pack 3.
Thanks
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have no idea, because I have no clue what that DLL is you are using. Is it something you've written yourself or from some third-party software package?
 
Kee Kee moon
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesper de Jong wrote:I have no idea, because I have no clue what that DLL is you are using. Is it something you've written yourself or from some third-party software package?



It is a third party software nitf.jni-c.dll. So far, I still could not resolve the problem.

Thanks a lot anyway.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it would be a good idea to contact the people / company who wrote that DLL and ask them if this is a problem that they know about.
 
Nothing up my sleeve ... and ... presto! A tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic