LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Using shared objects (.so) with Java on Linux based Cloud (https://www.linuxquestions.org/questions/linux-server-73/using-shared-objects-so-with-java-on-linux-based-cloud-862958/)

cos.im.fiah 02-15-2011 09:54 PM

Using shared objects (.so) with Java on Linux based Cloud
 
Hi all,

I am new to Linux and need help on the following matter, hopefully Linux experts out there can help me!:hattip:

I want to create a Java Servlet that will interface with a shared object (.so) library. The library is a component provided by a SDK manufacturer.

This Java Servlet will be hosted on Apache Tomcat running in the Amazon Web Service (AWS) Cloud.

Is all these possible? :scratch: And could you point me in the right direction?

Thanks!

paulsm4 02-16-2011 12:55 AM

Yes, it's possible.

No, it probably won't be easy.

If you MUST interface 'C' code (i.e. code in a 3rd party .so) with Java, then your first stop should be to familiarize yourself with JNI.

I would create some standalone Java/JNI test programs that invoke the .so first, before I try to integrate them into the servlet.

'Hope that helps .. PSM

cos.im.fiah 02-17-2011 07:52 PM

Hi paulsm4,

Thanks for your suggestions!

I was thinking the same approach on writing a JNI wrapper for my library and yes it won't be easy..
But I would give that a try, at least now i know it is possible! :D

Another way i was thinking was to create a Linux command-line executable in C++ to my library and run this executable from Java itself. The executable would take several parameters and perform its processes and return the results. Do you think this is a good idea? :scratch:


All times are GMT -5. The time now is 03:52 PM.