Java JNI
http://xxw8393.blog.163.com/blog/static/3725683420091023535411/
Java µÄ³öÏÖ¸ø´ó¼Ò¿ª·¢´øÀ´µÄ¼«´óµÄ·½±ã¡£µ«ÊÇ£¬Èç¹ûÎÒÃÇÓдóÁ¿ÔÓеľ¹ý¹ã·º²âÊԵķÇJava´úÂ룬½«ËüÃÇÈ«²¿ÓÃJavaÀ´ÖØд£¬¿ÖÅ»á´øÀ´¾Þ´óµÄ¹¤×÷Á¿ºÍ³¤ÆڵIJâÊÔ£»Èç¹ûÎÒÃǵÄÓ¦ÓÃÖÐÐèÒª·ÃÎʵ½Ìض¨µÄÉ豸£¬ÉõÖÁÊǽö·ûºÏ¹«Ë¾ÄÚ²¿ÐÅÏ¢½»»¥¹æ·¶µÄÉ豸£¬»òij¸öÌض¨µÄ²Ù×÷ϵͳ²ÅÓеÄÌØÐÔ£¬Java¾ÍÏÔµÃÓÐЩÁ¦²»´ÓÐÄÁË¡£Ãæ¶ÔÕâЩÎÊÌ⣬Sun¹«Ë¾ÔÚJDK1.0ÖоͶ¨ÒåÁËJNI¹æ·¶£¬Ëü¹æ¶¨ÁËJavaÓ¦ÓóÌÐò¶Ô±¾µØ·½·¨µÄµ÷ÓùæÔò¡£
»ØÒ³Ê×
ʵÏÖ²½Öè¼°Ïà¹Øº¯ÊýʹÓÃ
±¾ÎĽ«Ò»²½²½ËµÃ÷ÔÚLinuxƽ̨ÏÂÈçºÎʵÏÖ±¾µØ¹²Ïí¿âÓëJavaÐͬ¹¤×÷¡£Hello World³ÌÐòÊÇÄ¿Ç°±ê×¼µÄÈëÃŵÚÒ»²½£¬ÄÇô£¬ÎÒÒ²ÒÔÀàËƵÄÓ¦ÓÃ×îΪÑùÀý¡£
µÚÒ»²½£¬¶¨ÒåÒ»¸ö Java Àà -- Hello. ËüÌṩSayHello·½·¨£º
´ËʱӦעÒâÁ½µã£º
1.ΪҪʹÓõÄÿ¸ö±¾µØ·½·¨±àд±¾µØ·½·¨ÉùÃ÷£¬ÆäÉùÃ÷·½Ê½ÓëÆÕͨ Java ·½·¨½Ó¿Úûʲô²»Í¬£¬Ö»ÊDZØÐëÖ¸¶¨ native ¹Ø¼ü×Ö£¬ÈçÏÂËùʾ£º
de>public native void SayHello(String strName);de>
ÔÚÕâ¸öº¯ÊýÖУ¬ÎÒÃǽ«¸ù¾Ý´«½øµÄÈËÃû£¬ÏòijÈËÎʺá£
2.±ØÐëÏÔʽµØ¼ÓÔر¾µØ´úÂë¿â¡£ÎÒÃÇÐèÔÚÀàµÄÒ»¸ö¾²Ì¬¿éÖмÓÔØÕâ¸ö¿â£º
static
{
System.loadLibrary("hello");
}
ÔÙ¼ÓÉϱØÒªµÄÒì³£´¦Àí¾ÍÉú³ÉÈçÏÂÔ´ÎļþHello.java£º
public class Hello
{
static
{
try
{
//´Ë´¦¼´Îª±¾µØ·½·¨ËùÔÚÁ´½Ó¿âÃû
System.loadLibrary("hello");
}
catch(UnsatisfiedLinkError e)
{
System.err.println( "Cannot load hello library:\n " +
e.toString() );
}
}
public Hello()
{
}
//ÉùÃ÷µÄ±¾µØ·½·¨
public native void SayHello(String strName);
}
±àÒëºóÉú³ÉHello.classÎļþ¡£
µÚ¶þ²½£¬Éú³É±¾µØÁ´½Ó¿â¡£¾ßÌå¹ý³ÌÈçÏ£º
1. ҪΪÒÔÉ϶¨ÒåµÄÀàÉú³É Java ±¾µØ½Ó¿ÚÍ·Îļþ£¬ÐèʹÓÃjavah£¬Java ±àÒëÆ÷µÄ javah ¹¦Äܽ«¸ù¾Ý HelloÀàÉú³É±ØÒªµÄÉùÃ÷£¬´ËÃüÁÉú³ÉHello.h Îļþ£¬ÎÒÃÇÔÚ¹²Ïí¿âµÄ´úÂëÖÐÒª°üº¬Ëü£¬javah²»Ê¹Ä¬ÈÏÄÚ²¿ÃüÁÐèÒªÖ¸Ã÷·¾¶£¬ËüÔÚJDKµÄbinĿ¼Ï£¬ÔÚÎÒµÄLinux»·¾³ÏÂÃüÁîÈçÏ£º
/home/jbuilder/jdk1.3.1/bin/javah Hello
Éú³ÉµÄHello.h Îļþ ÄÚÈÝÈçÏÂËùʾ£º
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Hello */
#ifndef _Included_Hello
#define _Included_Hello
#ifdef __cplusp
Ïà¹ØÎĵµ£º
×î½ü¹«Ë¾Åöµ½ÐèÒªÓÃͼ±íµÄÐÎʽÏÔʾһЩÊý¾Ý£¬ÎҾͿªÊ¼µ½ÍøÉϲéѯ£¬²éµ½ÁËjfreechartºÍamcharts,ÕâÁ½ÕßÎÒ¶¼ÊµÏÖ¹ýÁË£¬jfreechart×îºóÉú³ÉͼƬ£¬µ«ÊÇͼƬЧ¹û²»ÊÇÎÒÏëÒªµÄ£¬È»ºóÓÖÑо¿amcharts ËüµÄЧ¹ûȷʵºÜºÃ£¬¶øÇÒ¹Ù·½ÍøÕ¾ÉÏ»¹ÓкÃЩÀý×ӿɹ©ÏÂÔØ£¬ÍøÖ·ÊÇ:www.amcharts.com
£¨ÏëÒªÍê³ÉÒ»¸öamchartsͼÐÎÐèÒªswfobjects. ......
Ä¿Ç°ºÜ¶àѧÉúÃæÁÙמÍÒµµÄÎÊÌ⣬µ±È»£¬ÏñÎÒÒ»ÑùµÄ¸Õ±ÏÒµµÄ´óѧÉúÒ²²»ÀýÍâ¡£´óѧʱѧµÄÊǼÆËã»úרҵµÄ£¬´óѧËÄÄê×ÜÒÔΪ°Ñרҵ¿ÎѧºÃ£¬±ÏÒµÁ˾ͿÉÒÔÕÒµ½Ò»·Ý²»´íµÄ¹¤×÷¡£
¿ÉÊǼ¸¸öÔÂÃæÊԵĽÓÁ¬Åö±Ú£¬Ê¹ÎҸе½´óѧÀïѧµÄרҵ֪ʶÀíÂÛÐÔÌ«Ç¿£¬Êµ¼Ê ......
ÕÐÉÌÏîÄ¿ÐèÒªÒý½øÒ»¸ö¹¤×÷Á÷£¬×î½üÔÚÍùÉϵ÷ÑпªÔ´µÄ¹¤×÷Á÷ÒýÇ棬×ܽá±È½ÏÁ÷ÐÐÒ»¹²ÓÐ3¸ö¡£
ÆäÖÐÒ»¸öÊÇosworkflow£¬µ«ÊÇÓÉÓںܳ¤Ê±¼ä²»ÔÙ¸üУ¬ËùÒÔÑ¡Ôñ·ÅÆú¡£ÁíÍâÒ»¸ö¾ÍÊÇjbmp4.3£¬¿ªÁ˺ܶàµÄ×ÊÁÏ»¹ÓÐÊÓƵ£¬·¢ÏÖÆäÖкܶණÎ÷Àí½âÀ§ÄÑ£¬»¹ÓÐÒ»¸öÎÊÌâ¾ÍÊÇËüµÄ³Ö¾Ã²ãÊÇhibernate×öµÄ£¬±¾ÏëÏÈÇ°ÏëÓÃibatisµÄ¡£¹À¼ÆÒªÊÇÕæµÄÒý½ø¹ ......
ÔÚJavaÖУ¬²»Í¬µÄÀ඼ÓÐ×Ô¼ºµ¥¶ÀµÄCache»úÖÆ£¬ÊµÏֵķ½·¨Ò²¿ÉÄÜÓÐËù²»Í¬£¬ÎÄÕÂÁоÙÁËJavaÖг£¼ûµÄ¸÷ÀàCache»úÖƵÄʵÏÖ·½·¨£¬Í¬Ê±½øÐÐÁË×ۺϵıȽϡ£
OSCache
OSCacheÊǸöÒ»¸ö¹ã·º²ÉÓõĸßÐÔÄܵÄJava EE»º´æ¿ò¼Ü£¬OSCacheÄÜÓÃÓÚÈκÎJavaÓ¦ÓóÌÐòµÄÆÕͨµÄ»º´æ½â¾ö·½°¸¡£
OSCacheÓÐÒÔÏÂÌص㣺»º´æÈκζÔÏó£¬Äã¿ÉÒÔ²»ÊÜÏÞÖƵ ......
¡¾×ª¡¿JavaÖеÄλÔËËã·û
Ô×÷ÕߣºRosen Jiang ³ö´¦£ºhttp://www.blogjava.net/rosen
ÒÆλÔËËã·û
°üÀ¨£º
“>> ÓÒÒÆ”£»“<< ×óÒÆ”£»“>>> ÎÞ·ûºÅÓÒÒÆ”
Àý×Ó£º
-5>>3=-1
1111 1111 1111 1111 1111 1111 1111 ......