• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天下

            記錄修行的印記

            1、Use native code through JNI (HelloWorld)

            https://www.rgagnon.com/topics/java-jni.html

             

            Use native code through JNI (HelloWorld)

            Use native code through JNITag(s): JNI

            With MSVC6, create a new Win32 DLL project (simple) and call it javahowto.

            In the same directory create a java source called JavaHowTo.java 
            class JavaHowTo {
              public native String sayHello();
              static {
                System.loadLibrary("javahowto"); 
              }
            }
            Compile the Java program and use javah utility to generate the JavaHowTo.h header file.
            javah -jni JavaHowTo
            In MSVC6, add the JavaHowTo.h in your project header files
            In the Tools - Options menu, set the include directories to include the Java JNI headers files. They are located in [jdk dir]\include and [jdk dir]\include\win32 directories
            In the javahowto.cpp source, add
            #include "JavaHowTo.h" 

            JNIEXPORT jstring JNICALL Java_JavaHowTo_sayHello
              (JNIEnv *env, jobject obj) {
                return  env->NewStringUTF("Hello world");
            }
            Select the Release configuration and build the project.
            Copy the javahowto.dll in the same directory as the java program.
            Create this new java program
            public class JNIJavaHowTo {
              public static void main(String[] args) {
                JavaHowTo jht = new JavaHowTo();
                System.out.println(jht.sayHello());
                }
            }
            Compile and execute.





            posted on 2019-12-06 10:50 天下 閱讀(296) 評論(0)  編輯 收藏 引用 所屬分類: C/C++Java

            <2012年8月>
            2930311234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            導航

            統計

            常用鏈接

            留言簿(4)

            隨筆分類(378)

            隨筆檔案(329)

            鏈接

            最新隨筆

            搜索

            最新評論

            国产精品美女久久久久网| 一级做a爰片久久毛片看看| 亚洲综合熟女久久久30p| 亚洲欧美一级久久精品| 少妇被又大又粗又爽毛片久久黑人| 国产成人无码精品久久久免费| 久久精品国产精品青草| 91麻豆精品国产91久久久久久| 91亚洲国产成人久久精品网址| 99热成人精品免费久久| 欧美久久综合九色综合| 久久中文字幕人妻丝袜| 久久久精品人妻一区二区三区蜜桃 | 久久天堂AV综合合色蜜桃网 | 久久男人中文字幕资源站| 欧美久久亚洲精品| 久久精品国产亚洲av麻豆蜜芽| 精品久久久无码21p发布| 囯产极品美女高潮无套久久久| 午夜久久久久久禁播电影| 久久99精品国产一区二区三区| 日本精品久久久久中文字幕 | 国产69精品久久久久久人妻精品| 国产V综合V亚洲欧美久久| 久久久久久久综合日本| 亚洲中文字幕无码久久综合网| 国产情侣久久久久aⅴ免费| 久久强奷乱码老熟女网站| 伊人久久大香线蕉综合影院首页| 国产精品一区二区久久国产| 日韩久久无码免费毛片软件| 亚洲精品国产美女久久久| 精品国产热久久久福利| 一本一本久久a久久综合精品蜜桃| 久久久久国产精品| 伊人久久精品无码二区麻豆| 久久精品国产欧美日韩| 狠狠色丁香久久婷婷综| 精品久久久久久中文字幕大豆网| 91久久精品视频| 久久精品国产亚洲av麻豆色欲|