how to understand the java code wrapping around C or other dependency libraries?

Z

zyng

Our java program(running on linux) needs calling a C program installed on our linux machine. It works fine!

The thing I don't understand is when we deliver our product(the Java program) to our clients, who are using the same version Red Hat linux machines asus, but don't have that C program installed(it's very painful to install that C program for us due to the fact that the Red Hat version was old and the dependency library files are either out-of-dated or just not there. It took us a great amount of effort to install that C program. So we cannot assume or require our clients to install that program)

I sort of know that no need to ask the clients to install the C program on their linux machine. We can wrap all the needed *.o library files in the delivered JAR files and in our Java code, use this code:
System.load("the_c_program")
and set environment variable "LD_LIBRARY_PATH" to point to the location of those *.o files within the JAR file

But I just feel unclear about this procedure. If you know this and willing to explain to me all this is doing, I will greatly appreciate it.

This C program has its library files and its library files needs other library files on the system. So, which library files needs to be selected and packed inside our JAR is unclear for me right now.

Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top