make:makefile-java-and-c
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious 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 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.1705346489.txt.gz · Last modified: 2024/01/15 21:21 by odefta