- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- UnsatisfiedLinkError when trying to load shared li...
Operating System - HP-UX
1760963
Members
5332
Online
108896
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2002 08:47 AM
тАО04-07-2002 08:47 AM
UnsatisfiedLinkError when trying to load shared library containing native method
I'm using Java 1.1.8.04 on HP-UX 10.20.
I've created a Java class with a native method. I then used javah -jni MyClass to generate the native header file. I then implemented the method in C and compiled it into a shared library (.sl).
When I try and run the Java class, I get the following error:
java.lang.UnsatisfiedLinkError: no MyLib in shared library path
at java.lang.Runtime.loadLibrary(Runtime.java)
at java.lang.System.loadLibrary(System.java)
at
at java.lang.Thread.init(Thread.java)
The library is actually libMyLib.sl. In the Java class, I have
static {
System.loadLibrary("MyLib");
}
And, I've verified that the directory containing the shared library is in the SHLIB_PATH and LD_LIBRARY_PATH variables.
Any idea why its not able to find the library?
I've created a Java class with a native method. I then used javah -jni MyClass to generate the native header file. I then implemented the method in C and compiled it into a shared library (.sl).
When I try and run the Java class, I get the following error:
java.lang.UnsatisfiedLinkError: no MyLib in shared library path
at java.lang.Runtime.loadLibrary(Runtime.java)
at java.lang.System.loadLibrary(System.java)
at
at java.lang.Thread.init(Thread.java)
The library is actually libMyLib.sl. In the Java class, I have
static {
System.loadLibrary("MyLib");
}
And, I've verified that the directory containing the shared library is in the SHLIB_PATH and LD_LIBRARY_PATH variables.
Any idea why its not able to find the library?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2002 10:52 AM
тАО04-07-2002 10:52 AM
Re: UnsatisfiedLinkError when trying to load shared library containing native method
Well, thanks to HP-UX tech support, I was able to figure out the problem. They pointed me to the following document:
http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1/JNI_java1.html
By using this document I was able to figure out that the problem was caused, not because my library couldn't be found, but rather, because my library wasn't linked with some other necessary libraries.
Once I recompiled my shared library and added the following libraries to my link command, everything worked.
-lCsup -lstream -lstd
Hopefully this will help anyone else stuck in this situation.
http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1/JNI_java1.html
By using this document I was able to figure out that the problem was caused, not because my library couldn't be found, but rather, because my library wasn't linked with some other necessary libraries.
Once I recompiled my shared library and added the following libraries to my link command, everything worked.
-lCsup -lstream -lstd
Hopefully this will help anyone else stuck in this situation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2004 02:27 AM
тАО05-26-2004 02:27 AM
Re: UnsatisfiedLinkError when trying to load shared library containing native method
I had a some close problem this my library libLibrairie.sl (SHLIB_PATH=/patch/myenv).
I called the methode like this
System.loadLibrary ("libLibrairie");
It did not work.
System.loadLibrary ("Librairie");
Works better because unix adds the prefix "lib" by its owns.
I hope it will help you
By.
Emmanuel
I called the methode like this
System.loadLibrary ("libLibrairie");
It did not work.
System.loadLibrary ("Librairie");
Works better because unix adds the prefix "lib" by its owns.
I hope it will help you
By.
Emmanuel
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP