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

JAVAµ÷DLL,.JNI¼¼Êõʵ¼ù

¼øÓÚÅÀ³æ¿ª·¢ÐèÒªÒ»¸öͼƬ½âÎö¹¦Äܵĺ¯Êý£¬µ½ÍøÂçÉϲéÕÒÁËһЩjni·½ÃæµÄÄÚÈÝ£¬²¢×öÁË×Ô¼ºµÄһЩÐ޸ģ¬¾ßÌåÈçÏ£º
   Ä¿Ç°javaÓëdll½»»¥µÄ¼¼ÊõÖ÷ÒªÓÐ3ÖÖ£ºjni£¬jawinºÍjacob¡£Jni£¨Java Native Interface£©ÊÇsunÌṩµÄjavaÓëϵͳÖеÄÔ­Éú·½·¨½»»¥µÄ¼¼Êõ£¨ÔÚwindows\linuxϵͳÖУ¬ÊµÏÖjavaÓënative method»¥µ÷£©¡£Ä¿Ç°Ö»ÄÜÓÉc/c++ʵÏÖ¡£ºóÁ½¸ö¶¼ÊÇsourceforgeÉϵĿªÔ´ÏîÄ¿£¬Í¬Ê±Ò²¶¼ÊÇ»ùÓÚjni¼¼ÊõµÄwindowsϵͳÉϵÄÒ»¸öÓ¦Óÿ⡣Jacob£¨Java-Com Bridge£©ÌṩÁËjava³ÌÐòµ÷ÓÃmicrosoftµÄcom¶ÔÏóÖеķ½·¨µÄÄÜÁ¦¡£¶ø³ýÁËcom¶ÔÏóÍ⣬jawin£¨Java/Win32 integration project£©»¹¿ÉÒÔwin32-dll¶¯Ì¬Á´½Ó¿âÖеķ½·¨¡£¾Í¹¦ÄܶøÑÔ£ºjni >> jawin>jacob£¬Æä´óÖµĽṹÈçÏÂͼ£º
jni¼¼ÊõÌåϵ¹¦Äܽṹͼ
¾ÍÒ×ÓÃÐÔ¶øÑÔ£¬ÕýºÃÏà·´£ºjacob>jawin>>jni¡£
Jvm·â×°Á˸÷ÖÖ²Ù×÷ϵͳʵ¼ÊµÄ²îÒìÐÔµÄͬʱ£¬ÌṩÁËjni¼¼Êõ£¬Ê¹µÃ¿ª·¢Õß¿ÉÒÔͨ¹ýjava³ÌÐò£¨´úÂ룩µ÷Óõ½²Ù×÷ϵͳÏà¹ØµÄ¼¼ÊõʵÏֵĿ⺯Êý£¬´Ó¶øÓëÆäËû¼¼ÊõºÍϵͳ½»»¥£¬Ê¹ÓÃÆäËû¼¼ÊõʵÏÖµÄϵͳµÄ¹¦ÄÜ£»Í¬Ê±ÆäËû¼¼ÊõºÍϵͳҲ¿ÉÒÔͨ¹ýjniÌṩµÄÏàÓ¦Ô­Éú½Ó¿Ú¿ªµ÷ÓÃjavaÓ¦ÓÃϵͳÄÚ²¿ÊµÏֵŦÄÜ¡£
ÔÚwindowsϵͳÉÏ£¬Ò»°ã¿ÉÖ´ÐеÄÓ¦ÓóÌÐò¶¼ÊÇ»ùÓÚnativeµÄPE½á¹¹£¬windowsÉϵÄjvmÒ²ÊÇ»ùÓÚnative½á¹¹ÊµÏֵġ£JavaÓ¦ÓÃÌåϵ¶¼Êǹ¹½¨ÓÚjvmÖ®ÉÏ¡£
WindowsϵͳÉϵÄjavaÌåϵ
Jni¶ÔÓÚÓ¦Óñ¾ÉíÀ´Ëµ£¬¿ÉÒÔ¿´×öÒ»¸ö´úÀíģʽ¡£¶ÔÓÚ¿ª·¢ÕßÀ´Ëµ£¬ÐèҪʹÓÃc/c++À´ÊµÏÖÒ»¸ö´úÀí³ÌÐò£¨jni³ÌÐò£©À´Êµ¼Ê²Ù×÷Ä¿±êÔ­Éúº¯Êý£¬java³ÌÐòÖÐÔòÊÇjvmͨ¹ý¼ÓÔز¢µ÷ÓôËjni³ÌÐòÀ´¼ä½ÓµØµ÷ÓÃÄ¿±êÔ­Éúº¯Êý¡£
Jniµ÷Óùý³ÌʾÒâͼ
l        Jni³ÌÐò¿ª·¢µÄÒ»°ã²Ù×÷²½ÖèÈçÏ£º
1.      ±àдjavaÖеĵ÷ÓÃÀ࣬²¢ÓÃjavac   °üÃû.*.java ÃüÁî µÃµ½¸Ãµ÷ÓÃÀàµÄclassÎļþ
2.      ÓÃjavah °üÃû.* Éú³Éc/c++Ô­Éúº¯ÊýµÄÍ·Îļþ
3.        c/c++Öе÷ÓÃÐèÒªµÄÆäËûº¯Êý¹¦ÄÜ£¬ÊµÏÖÔ­Éúº¯Êý(Ô­ÔòÉÏ¿ÉÒÔµ÷ÓÃÈκÎ×ÊÔ´)
4.        ½«ÏîÄ¿ÒÀÀµµÄËùÓÐÔ­Éú¿âºÍ×ÊÔ´¼ÓÈëµ½javaÏîÄ¿µÄjava.library.path
5.      Éú³Éjavaµ÷ÓÃÀà¶ÔÓ¦µÄdll¿â
6.      ·¢²¼javaÓ¦ÓúÍdll¿â
l       


Ïà¹ØÎĵµ£º

Java»ù±¾Êý¾ÝÀàÐ͵ÄÈ¡Öµ·¶Î§

 ÏÈ¿´Ò»¶Î´úÂë
public class Hello{
    public static void main(String[] args){
        int i  = 5 ,  j = 2;
        System.out.println(i+j);
      ......

Tomcat java ¶¨Ê±ÈÎÎñ

Á½¸ötomcat Java¶¨Ê±ÈÎÎñµÄÀý×Ó
ÀýÒ»£º
±¾ÀýÒÀ¾ÝJava×ÔÉíÌṩµÄ½Ó¿ÚʵÏÖ£¬Í¨¹ý¼àÌýÆ÷£¨Listener£©ºÍ¶¨Ê±Æ÷£¨Timer£©¶¨Ê±Ö´ÐÐij¸öÈÎÎñ£¨Task£©¡£
רҵµÄ¿ªÔ´¹¤¾ß¿É²Î¿¼Quartz£ºhttp://www.opensymphony.com/quartz/
MyListener£º
import
 java.util.Timer;
import
 javax.servlet.ServletContextEvent;
i ......

javaÏ̳߳صÄÔ­ÀíÓëʵÏÖ

javaÏ̳߳صÄÔ­ÀíÓëʵÏÖ



[·ÖÏí]Java Ï̳߳صÄÔ­ÀíÓëʵÏÖ2008-07-18
14:53------------------------------------------------------------------------------------------------
Õ⼸ÌìÖ÷ÒªÊÇ¿ñ¿´Ô´³ÌÐò£¬ÔÚÃÖ²¹ÁËһЩÒÔǰ֪ʶ¿Õ°×µÄͬʱ£¬Ò²Ñ§»áÁ˲»ÉÙеÄ֪ʶ£¨±ÈÈç NIO£©£¬»òÕß³ÆΪм¼Êõ°É ......

java»ñÈ¡µ±Ç°Ê±¼ä£¨×ªÔØ£©


ÓÐÁ½ÖÖ·½·¨£º
·½·¨Ò»£ºÓÃjava.util.DateÀàÀ´ÊµÏÖ£¬²¢½áºÏjava.text.DateFormatÀàÀ´ÊµÏÖʱ¼äµÄ¸ñʽ»¯£¬¿´ÏÂÃæ´úÂ룺
import java.util.*;
import java.text.*;
//ÒÔÏÂĬÈÏʱ¼äÈÕÆÚÏÔʾ·½Ê½¶¼ÊǺºÓïÓïÑÔ·½Ê½
//Ò»°ãÓïÑÔ¾ÍĬÈϺºÓï¾Í¿ÉÒÔÁË£¬Ê±¼äÈÕÆڵĸñʽĬÈÏΪMEDIUM·ç¸ñ£¬±ÈÈ磺2008-6-16 20:54:53
//ÒÔÏÂÏÔʾµÄÈ ......

ʹÓÃJNI¼¼ÊõʵÏÖJAVA³ÌÐòµ÷ÓÃdll

JAVAµÄ¿çƽ̨µÄÌØÐÔÉîÊÜjava³ÌÐòÔ±ÃǵÄϲ°®,µ«ÕýÊÇÓÉÓÚËüΪÁËʵÏÖ¿çƽ̨µÄÄ¿µÄ,ʹµÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ,´ó´óÔ¼ÊøÁËËüµÄ¹¦ÄÜ,±ÈÈçÓëһЩӲ¼þÉ豸ͨÐÅ,ÍùÍùÒª»¨·ÑºÜ´óµÄ¾«Á¦È¥Éè¼ÆÁ÷³Ì±àд´úÂëÈ¥¹ÜÀíÉ豸¶Ë¿Ú,¶øÇÒÓÐһЩÉ豸³§ÉÌÌṩµÄÓ²¼þ½Ó¿ÚÒѾ­¾­¹ýÒ»¶¨µÄ·â×°ºÍ´¦Àí,²»ÄÜÖ±½ÓʹÓÃjava³ÌÐòͨ¹ý¶Ë¿ÚºÍÉè±¸Í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ