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

Javaµ÷ÓÃC/C++ – JNI

×òÌì²Å¿´µ½£¬µ«ÊÇÓöµ½Ò»Ð©ÎÊÌ⣬½ñÌì½â¾öÁË£¬¼ÇÏ¡­¡­£¨²Î¿¼£ºhttp://netbeans.org/kb/55/beginning-jni-part1.html£©
ÎÒÓõÄÊÇNetbeans 6.7£¬µ«ÊǺÍÆäËûµÄÒ²Ó¦¸Ã´óͬСÒì°É¡£ »ù±¾Á÷³Ì£º JavaÕâ±ßµÄ£º
´´½¨javaÎļþ£¨´ønativeµÄ£©£¬»¹Òª¼ÇµÃÔÚÀàÖмÓÈ룺System.loadLibrary(xxx) ¡£
È»ºóÓÃjavahÀ´Éú³ÉC/C++µÄÍ·Îļþ£¨±ÈÈ磺javah –o pzc.h –jni –classpath ¡­ pzjava.Main£©¡£ CÕâ±ßµÄ£º
×öÒ»¸ö¡°Öмä²ã¡±µÄC»òÕßC++Îļþ£¬include¸Õ²ÅÉú³ÉµÄÍ·Îļþ£¬°Ñ·½·¨¸´ÖÆÏÂÀ´¡£
»¹Òª¼ÇµÃ°Ñ%JAVA_HOME%\include\ºÍ%JAVA_HOME%\include\win32Ìí¼Óµ½±àÒëÆ÷µÄÍ·ÎļþËÑË÷·¾¶ÖУ¨»¹ÒªÌí¼ÓÉϸոÕÉú³ÉµÄÍ·ÎļþµÄËÑË÷·¾¶£© ¡£
ҪעÒâÉèÖúñàÒëÆ÷Êä³öµÄ¶¯Ì¬¿âÎļþÃû£¬ÒªºÍloadLibraryÖеÄÒ»Ö£¨ÔÚWindowsÏÂÈç¹ûxxxÊÇ"pzc¡±£¬ÄÇÊä³öµÄ¾ÍÊÇpzc.dll£¬Èç¹ûÊÇlinux£¬¾ÍÊÇlibpzc.so£©¡£
»¹Òª×¢ÒâÉèÖñàÒëÆ÷µÄÆäËû²ÎÊý£¬È磺--add-stdcall-alias£¨ÔÚWindowsÏÂÐèÒª£©£¨²é¿´gccÊÖ²á¾ÍÖªµÀËüµÄÒâ˼£©¡£
±àÒëºÃdllºó°Ñdll¸´ÖƵ½javaÏîÄ¿¿Õ¼ä¾ÍÐÐÁË¡£ ÓÐʱgccÑ¡ÏҪ¼Ó-m32£¬°´ÕÕÔ­ÎÄËù˵µÄ£¬Òâ˼Ӧ¸ÃÊÇ£¬Èç¹ûÊÇÔÚ64λµÄ»úÆ÷ÉÏÏëÒª°Ñdll±àÒë³É32λµÄ»°£¬ÄǾÍÒª¼ÓÉÏÕâ¸öÑ¡Ïî¡£


Ïà¹ØÎĵµ£º

java ʼþ»úÖÆ̽ÌÖ

javaÖеÄʼþ»úÖƵIJÎÓëÕßÓÐ3ÖÖ½ÇÉ«£º
1.event object£º¾ÍÊÇʼþ²úÉúʱ¾ßÌåµÄ“ʼþ”£¬ÓÃÓÚlistenerµÄÏàÓ¦µÄ·½·¨Ö®ÖУ¬×÷Ϊ²ÎÊý£¬Ò»°ã´æÔÚÓëlisternerµÄ·½·¨Ö®ÖÐ
2.event source£º¾ßÌåµÄ½ÓÊÜʼþµÄʵÌ壬±ÈÈç˵£¬Äãµã»÷Ò»¸öbutton£¬ÄÇôbutton¾ÍÊÇevent source£¬ÕâÑùÄã±ØÐëʹbutton¶ÔijЩʼþ½øÐÐÏàÓ¦£¬Äã¾ÍÐè ......

java.lang.OutOfMemoryError: Java heap space

 
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖ ......

ÀûÓÃjava Api½âÎöXML

import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import or ......

Java ¶àÏ̱߳à³ÌÖ®Èý£ºsynchronized ¹Ø¼ü×ÖµÄʹÓÃ

Java ¶àÏ̱߳à³ÌÖ®Èý£ºsynchronized ¹Ø¼ü×ÖµÄʹÓÃ
        ´øÓÐ synchronized ¹Ø¼ü×ֵķ½·¨´ú±íÕâ¸ö·½·¨¼ÓËø¡£Ç¡µ±¶øÓÖÁé»îµØÔËÓà synchronized ¹Ø¼ü×Ö£¬ÊǶàÏ̱߳à³ÌµÄ±ØÐ޿Ρ£
¡¡¡¡1¡¢synchronized¹Ø¼ü×ÖµÄ×÷ÓÃÓòÓжþÖÖ£º
¡¡¡¡1£©ÊÇij¸ö¶ÔÏóʵÀýÄÚ£¬synchronized aMethod(){}¿ÉÒÔ·ÀÖ¹¶à ......

´ø×Åjavaѧpython

 pythonÕýÎÄ£º     ºÍÆäËüÓïÑÔÒ»Ñù£¬ÎÒÃÇ¿ÉÒÔÒÔÃüÁîÐеÄÐÎʽ¸øÄãµÄpython³ÌÐò´«µÝ²ÎÊý£¬pyhtonÄܹ»×Ô¶¯°ÑÃüÁîÐвÎÊýÒÔ×Ö·û´®ÁбíµÄÐÎʽ´æ´¢ÔÚsysÄ£¿éµÄarv±äÁ¿¡£ok£¬ÎÒÃÇÏÈÀ´¿´¸öÀý³Ì£º
 
#  ÎļþÃû: printargs.py
#ÓÃ;£ºÑÝʾpythonµÄ´«²Î
import sys
print sys.argv
ÔÚÃü ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ