Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux JNIʵÀý¼°ÆäJNI³ÌÐòÉè¼ÆÄ£°å

¼òµ¥ÊµÀý˵Ã÷´ý²¹³ä£¬ÊµÀýÔ´Âë¿ÉÔÚ´ËÁ´½ÓÏÂÔØhttp://d.download.csdn.net/down/2389895/sanlinux
jniNative.cpp
#include "jniNative.h"
#include "mymain.h"
#include <stdio.h>
JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject arg, jstring instring)
{
    const char *str = (const char *)env->GetStringUTFChars(instring, JNI_FALSE);
    printf("HELLO,%s\n",str);
    env->ReleaseStringUTFChars(instring,str);
    return;
}
JNIEXPORT void JNICALL Java_HelloWorld_test(JNIEnv *env, jobject arg, jstring instring)
{
    const jbyte *str = (const jbyte *)env->GetStringUTFChars(instring, JNI_FALSE);
    test((const char *)str);
    env->ReleaseStringUTFChars(instring, (const char *)str);
    return;
}
jniNative.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class HelloWorld */
//javac HelloWorld.java
//javah HelloWorld
//Copy from HelloWorld.h
#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     HelloWorld
 * Method:    print
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_HelloWorld_print
  (JNIEnv *, jobject, jstring);
/*
 * Class:     HelloWorld
 * Method:    test
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_HelloWorld_test
  (JNIEnv *, jobject, jstring);
#ifdef __cplusplus
}
#endif
#endif
mymain.cpp
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mymain.h"
void test(const char *str)
{
    char ch[50];
    int len = 0;
   
    strcat(ch,"Hello ");
&nbs


Ïà¹ØÎĵµ£º

Linux shell

Linux ²é¿´ËùÓл·¾³±äÁ¿ÃüÁexpoert ºÍ  env ¡£
               Ö¸¶¨»·¾³±äÁ¿£ºecho $XXX,(XXX´ú±í»·¾³±äÁ¿Ãû)
¸ü¸Ä»·¾³±äÁ¿Öµ·½·¨£º
1.ÐÞ¸Ä/etc/profileÎļþ
Àý£ºÔÚprofileÎļþĩβ¼ÓÈ룺
JAVA_HOME=/usr/share/jdk1.5.0_05
P ......

Linux Shell×Ô¶¯½»»¥µÄÈýÖÖ·½·¨


ÄãÁ˽âLinuxϵͳô£¿ÄãÊÇLinuxϵͳµÄÓ¦ÓÃÕßô£¿Èç¹ûÄãҪѧϰlinux£¬Äã¿ÉÄÜ»áÓöµ½Linux Shell×Ô¶¯½»»¥ÎÊÌ⣬ÕâÀォ½éÉÜLinux Shell×Ô¶¯½»»¥µÄ½â¾ö·½·¨£¬ÔÚÕâÀïÄóöÀ´ºÍ´ó¼Ò·ÖÏíһϡ£
Ò»¡¢±³¾°
shell½Å±¾ÔÚ´¦Àí×Ô¶¯Ñ­»·»ò´óµÄÈÎÎñ·½Ãæ¿É½ÚÊ¡´óÁ¿µÄʱ¼ä£¬Í¨¹ý´´½¨Ò»¸ö´¦ÀíÈÎÎñµÄÃüÁîÇåµ¥£¬Ê¹ÓñäÁ¿¡¢Ìõ¼þ¡¢ËãÊõºÍÑ­»·µÈ·½ ......

linuxÉ豸Çý¶¯±à³Ì ³õ̽£¨1£©

------linuxÉ豸Çý¶¯³ÌÐòµÄ¼ò½é
֮ǰֻÊÇ×öÏîÄ¿µÄʱºòÓùýÒ»¶Îʱ¼älinux£¬¶ÔlinuxÆäʵ²»ÔõôÊìϤ£¬µ«ÊÇ´óÖµIJÙ×÷£¬±à³ÌµÄ·½·¨£¬¹¤¾ß(eclipse, gcc)·½Ã滹ÊÇÉÔ΢¶®Ò»µãµÄ£¬¶ÔÓÚÎÒÀ´Ëµ£¬Ò»Ö±Ê¹ÓõÄÊÇCÓïÑÔ£¨¶àÊýǶÈëʽϵͳ¿ª·¢Ê¹Óã©£¬Ò»Ö±Ï뻨µãʱ¼äÀ´ºÃºÃµÄѧϰһÏÂlinuxϵÄÇý¶¯¿ª·¢£¬ÕýºÃÕâ¶Îʱ¼äÒ»Ö±ÔÚ´ýÒµ½×¶Î£¬¾ÍºÃº ......

LinuxµÄmake³ÌÐò

ÔÚ¿ª·¢Ò»¸öϵͳʱ£¬Ò»°ãÊǽ«Ò»¸öϵͳ·Ö³É¼¸¸öÄ£¿é£¬ÕâÑù×öÌá¸ßÁËϵͳµÄ¿Éά»¤ÐÔ£¬µ«ÓÉÓÚ¸÷¸öÄ£¿é¼ä²»¿É±ÜÃâ´æÔÚ¹ØÁª£¬ËùÒÔµ±Ò»¸öÄ£¿é¸Ä¶¯ºó£¬ÆäËûÄ£¿éÒ²Ðí»áÓÐËù¸üУ¬µ±È»¶ÔСϵͳÀ´Ëµ£¬ÊÖ¹¤±àÒëÁ¬½ÓÊÇûÎÊÌ⣬µ«ÊÇÈç¹ûÊÇÒ»¸ö´óϵͳ£¬´æÔںܶà¸öÄ£¿é£¬ÄÇôÊÖ¹¤±àÒëµÄ·½·¨¾Í²»ÊÊÓÃÁË¡£Îª´Ë£¬ÔÚLinuxϵͳÖУ¬×¨ÃÅÌṩÁËÒ»¸öm ......

linuxÏÂÄ£Äâ¼üÅ̵ļ¸ÖÖ·½·¨

1¡¢Ê¹ÓÃGTKÖеÄGdkEvent
    GdkEvent *event;
    event = gdk_event_new (GDK_KEY_PRESS);              //°´¼ü°´ÏÂ
    event->key.send_event = TRUE;
    event->key.keyva ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ