Skip to content

abrajByte/Communication-with-Java-Cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Communication with Java & Cpp

Here, we are calling cpp method in java class which will have params and return boolean.

#To generate .h file from java class

javac -h . HelloJNI.java

#To run the C or Cpp file

gcc -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -dynamiclib -o libhello.dylib HelloJNI.c

g++ for .cpp file

#To run the java file:

java -Djava.library.path=. HelloJNI

Or

javac -h . HelloJNI.java //compile

Java java HelloJNI //run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published