Skip to content

anupdw/JNI-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a sample program to illustrate Java Native Interface

Type the following commands on terminal to generate the header files. javac Hello.java javah -jni Hello

Next, we create the dynamic library file for Hello.c

gcc -c -I/System/Library/Framework/JavaVM.fremwork/Headers Hello.c

gcc -dynamiclib -o libHelloImpl.jnilib Hello.o -framework JavaVM

This will create the dynamic shared library file libHelloImp.jnilib

The above commands are specific to Mac OS X Operating System. Linux/Windows will have different way to compile and generate dynamic shared object files.

Run the program using the command: java Hello user1 3

About

A sample program to demonstrate Java Native Interface programming.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors