Solved

What does this error mean: Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path ?

Posted on 2008-09-30
9
1,715 Views
Last Modified: 2013-11-23
Hi,
 
   I'm writing a Java program and when I call a method that is included in a jar library, I get the following error:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path


  Any idea on what this error means?

Thanks!
0
Comment
Question by:pbenito
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 23

Expert Comment

by:cmalakar
ID: 22607526
>> java.lang.UnsatisfiedLinkError: no nitf.jni-c in java.library.path

Means a library file is missing the java library path.. If you know.. the library..
then add the library to the java.library.path as follows.. when you start the java program.

java -Djava.library.path=PathToYourLibrary ProgramName
0
 

Author Comment

by:pbenito
ID: 22607628
How do I do this in NetBeans?
0
 
LVL 23

Expert Comment

by:cmalakar
ID: 22607657
instead.. you can also do this..

In the first line of main function.. write..

System.setProperty("java.library.path", "PathToYourLibrary");
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:pbenito
ID: 22608113
I used the System.setProperty method and I get the same error.
0
 
LVL 9

Expert Comment

by:mbodewes
ID: 22608754
cmalaker, the setProperty method does not work. The default classloader won't notice changes in the java.library.path property. The -D option does work obviously. You could also put the library in the default windows path. Either add a folder to the windows path to store the library, or in extreme cases put the .dll in the windows folder or the bin folder of your Java runtime.
0
 

Author Comment

by:pbenito
ID: 22608859
I tried both options and I keep getting the same error.....any other ideas?
0
 
LVL 9

Accepted Solution

by:
mbodewes earned 500 total points
ID: 22609900
In netbeans, you should be able to pass the -Djava.library.path to the JVM. The property should be set to the path *excluding* the name of the file itself. The file itself should be called <libraryname>.dll (assuming windows) or <libraryname>.so in Linux. I presume you have found the .dll, can you explain what exact options you have tried?

Optionally, the library could also be loaded using the full path to the library from the .jar. In this case you will have to see the documentation of whoever supplied the jar library to you.
0
 

Author Comment

by:pbenito
ID: 22614020
That worked!!!  Why did I have to reference a .dll file?  I thought that Java doesn't use DLLs?
0
 
LVL 9

Expert Comment

by:mbodewes
ID: 22615288
"That worked!!!  Why did I have to reference a .dll file?  I thought that Java doesn't use DLLs?"

Java may use libraries to do native (as in "native to the operating system"). Without an interface to the operating system, there is very little Java can do. It would not be able to read files, create network sockets, create windows etc. etc. . Of course, the base JVM will make sure that the most common options like the ones I've mentioned are present for all platforms. For new platforms, this functionality will have to be provided.

That still leaves an awful lot of functionality that is not directly available within the Java runtime. Much of it you will never need, or can be recreated in the Java language itself. But if you want to access OS functionality (i.e. drivers) or CPU functionality (i.e. SSE "multimedia" instructions) directly, you will still need native code. This native code can be supplied in JNI compatible .dll's. This is what you are currently configuring.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question