Skip to content

sourabhjagtap95/BE_PRO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BE_PRO

This is related to BE Project

The objective is to create a shared object library file (or .so) and implementing java file to execute the required functions from library file.

It can be done by using Java Native Interface (JNI). To know more about it go to http://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html#fn:1 or http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html or http://web.archive.org/web/20120419230023/http://java.sun.com/docs/books/jni/html/start.html

Steps to run the file :

For compiling java file:

$ javac IPStructure.java
$ javah -jni IPStructure

For compiling C file

$ gcc -fPIC -o libip.so -shared -I /usr/lib/jvm/java-7-openjdk-amd64/include 
-I /usr/lib/jvm/java-7-openjdk-amd64/include/linux/ IPStructure.c

It creates a shared object library "libip.so"

$ export LD_LIBRARY_PATH = (current-directory):$LD_LIBRARY_PATH
$ java IPStructure

About

This is related to BE Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published