- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Java, JNI, aCC
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
12-12-1999 03:12 PM
12-12-1999 03:12 PM
Java, JNI, aCC
that I took.
1. Wrote the Java class.
public class HelloWorld {
public native void displayHelloWorld();
public static void main(String[] args) {
System.loadLibrary("hello");
new HelloWorld().displayHelloWorld();
}
}
2. javac HelloWorld.java
3. javah -jni HelloWorld
4. Wrote the c class
#include "HelloWorld.h"
#include
JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld
(JNIEnv *, jobject)
{
printf("Hello World");
return;
}
4. aCC -ext +z -c -D_HPUX -I/opt/java/include -I/opt/java/include/hp-ux hello.c
5. aCC -b -o libhello.sl hello.o -IC
6. export SHLIB_PATH=$(/bin/pwd):$SHLIB_PATH
However, when I try to run the java program using java HelloWorld, I got the
error java.lang.UnsatisfiedLinkError. Anyone knows what went wrong? TIA.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-1999 03:34 PM
12-12-1999 03:34 PM
Re: Java, JNI, aCC
file via chmod a+x. Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-1999 08:54 AM
12-13-1999 08:54 AM
Re: Java, JNI, aCC
Any other ideas? tia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-1999 07:35 PM
12-16-1999 07:35 PM
Re: Java, JNI, aCC
/opt/java/docs/hpux/JavaCallingNative
Run the "build" script and see if you still get an error similar to:
error: java.lang.UnsatisfiedLinkError: no aCCImpl in shared library path
If so, you may want to check what the version of your dld.sl (dynamic link
loader) is. Also, you may want to check what JDK version you are using. I was
testing with JDK1.17 and the "what" output of my dym link loader files is:
/usr/lib/dld.sl:
SMART_BIND
92453-07 dld dld dld.sl B.10.32 990202
/usr/lib/libdld.1:
92453-07 dld dld libdld.sl B.10.32 990202
I have PHSS_17225 dld.sl patch installed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-1999 05:18 PM
12-18-1999 05:18 PM
Re: Java, JNI, aCC
I able to run it and have found the problem with my code. I have
misunderstood that the shared library should be prefixed with libc instead of
c.
Thank you! Merry Christmas!