make:makefile-java-and-c
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
make:makefile-java-and-c [2024/01/15 21:21] – odefta | make:makefile-java-and-c [2024/01/15 21:23] (current) – odefta | ||
---|---|---|---|
Line 57: | Line 57: | ||
</ | </ | ||
- | To run the program | + | To run the program: |
< | < | ||
make run | make run | ||
Line 67: | Line 67: | ||
</ | </ | ||
+ | Hello.java: | ||
+ | <code java Hello.java> | ||
+ | public class Hello { | ||
+ | private native void sayHello(); | ||
+ | static { | ||
+ | System.loadLibrary(" | ||
+ | } | ||
+ | public static void main(String[] args) { | ||
+ | new Hello().sayHello(); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | <code c hello.c> | ||
+ | #include < | ||
+ | #include " | ||
+ | |||
+ | JNIEXPORT void JNICALL Java_Hello_sayHello(JNIEnv *env, jobject obj) { | ||
+ | printf(" | ||
+ | } | ||
+ | </ |
make/makefile-java-and-c.1705346478.txt.gz · Last modified: 2024/01/15 21:21 by odefta