ºìÁªLinuxÃÅ»§
Linux°ïÖú

JavaÐéÄâ»ú

·¢²¼Ê±¼ä:2006-05-03 19:36:09À´Ô´:ºìÁª×÷Õß:ÌìɽÀÏͯ
Ò»¡¢ ʲôÊÇJavaÐéÄâ»ú
JavaÐéÄâ»úÊÇÒ»¸öÏëÏóÖеĻúÆ÷,ÔÚʵ¼ÊµÄ¼ÆËã»úÉÏͨ¹ýÈí¼þÄ£ÄâÀ´ÊµÏÖ¡£JavaÐéÄâ»úÓÐ×Ô¼ºÏëÏóÖеÄÓ²¼þ,Èç´¦ÀíÆ÷¡¢¶ÑÕ»¡¢¼Ä´æÆ÷µÈ,»¹¾ßÓÐÏàÓ¦µÄÖ¸Áîϵͳ¡£

1.ΪʲôҪʹÓÃJavaÐéÄâ»ú?

JavaÓïÑÔµÄÒ»¸ö·Ç³£ÖØÒªµÄÌصã¾ÍÊÇÓëƽ̨µÄÎÞ¹ØÐÔ¡£¶øʹÓÃJavaÐéÄâ»úÊÇʵÏÖÕâÒ»ÌصãµÄ¹Ø¼ü¡£Ò»°ãµÄ¸ß¼¶ÓïÑÔÈç¹ûÒªÔÚ²»Í¬µÄƽ̨ÉÏÔËÐÐ, ÖÁÉÙÐèÒª±àÒë³É²»Í¬µÄÄ¿±ê´úÂë¡£¶øÒýÈëJavaÓïÑÔÐéÄâ»úºó,JavaÓïÑÔÔÚ²»Í¬Æ½Ì¨ÉÏÔËÐÐʱ²»ÐèÒªÖØбàÒë.

JavaÐéÄâ»úÆÁ±ÎÁËÓë¾ßÌåƽ̨Ïà¹ØµÄÐÅÏ¢,ʹµÃJavaÓïÑÔ±àÒë³ÌÐòÖ»ÐèÉú³ÉÔÚJavaÐéÄâ»úÉÏÔËÐеÄÄ¿±ê´úÂë(×Ö½ÚÂë),¾Í¿ÉÒÔÔÚ¶àÖÖƽ̨Éϲ»¼ÓÐ޸ĵØÔËÐС£JavaÐéÄâ»úÔÚÖ´ÐÐ×Ö½ÚÂëʱ,°Ñ×Ö½ÚÂë½âÊͳɾßÌåƽ̨ÉϵĻúÆ÷Ö¸ÁîÖ´ÐС£

2.Ë­ÐèÒªÁ˽âJavaÐéÄâ»ú


JavaÐéÄâ»úÊÇJavaÓïÑԵײãʵÏֵĻù´¡,¶ÔJavaÓïÑÔ¸ÐÐËȤµÄÈ˶¼Ó¦¶ÔJavaÐéÄâ»úÓиö´ó¸ÅµÄÁ˽⡣ÕâÓÐÖúÓÚÀí½âJavaÓïÑÔµÄһЩÐÔÖÊ,Ò²ÓÐÖúÓÚʹÓÃJavaÓïÑÔ¡£
¶ÔÓÚÒªÔÚÌض¨Æ½Ì¨ÉÏʵÏÖJavaÐéÄâ»úµÄÈí¼þÈËÔ±,JavaÓïÑԵıàÒëÆ÷×÷ÕßÒÔ¼°ÒªÓÃÓ²¼þоƬʵÏÖJavaÐéÄâ»úµÄÈËÀ´Ëµ,Ôò±ØÐëÉî¿ÌÀí½âJavaÐéÄâ»úµÄ¹æ·¶¡£
ÁíÍâ,Èç¹ûÄãÏëÀ©Õ¹ JavaÓïÑÔ,»òÊÇ°ÑÆäËüÓïÑÔ±àÒë³ÉJavaÓïÑÔµÄ×Ö½ÚÂë,ÄãÒ²ÐèÒªÉîÈëµØÁ˽âJavaÐéÄâ»ú¡£
3.JavaÐéÄâ»úÖ§³ÖµÄÊý¾ÝÀàÐÍ

JavaÐéÄâ»úÖ§³ÖJavaÓïÑԵĻù±¾Êý¾ÝÀàÐÍÈçÏÂ:

byte://1×Ö½ÚÓзûºÅÕûÊýµÄ²¹Âë short://2×Ö½ÚÓзûºÅÕûÊýµÄ²¹Âë int://4×Ö½ÚÓзûºÅÕûÊýµÄ²¹Âë long://8×Ö½ÚÓзûºÅÕûÊýµÄ²¹Âë float://4×Ö½ÚIEEE754µ¥¾«¶È¸¡µãÊý double://8×Ö½ÚIEEE754Ë«¾«¶È¸¡µãÊý char://2×Ö½ÚÎÞ·ûºÅUnicode×Ö·û

¼¸ºõËùÓеÄJavaÀàÐͼì²é¶¼ÊÇÔÚ±àÒëʱÍê³ÉµÄ¡£ÉÏÃæÁгöµÄԭʼÊý¾ÝÀàÐ͵ÄÊý¾ÝÔÚ JavaÖ´ÐÐʱ²»ÐèÒªÓÃÓ²¼þ±ê¼Ç¡£²Ù×÷ÕâЩԭʼÊý¾ÝÀàÐÍÊý¾ÝµÄ×Ö½ÚÂë(Ö¸Áî)±¾Éí¾ÍÒѾ­Ö¸³öÁ˲Ù×÷ÊýµÄÊý¾ÝÀàÐÍ,ÀýÈçiadd¡¢ladd¡¢faddºÍ daddÖ¸ÁÊÇ°ÑÁ½¸öÊýÏà¼Ó,Æä²Ù×÷ÊýÀàÐÍÌرðÊÇint¡¢long¡¢floatºÍdouble¡£
ÐéÄâ»úûÓиøboolean(²¼¶û)ÀàÐÍÉèÖõ¥¶ÀµÄÖ¸Áî¡£booleanÐ͵ÄÊý¾ÝÊÇÓÉintegerÖ¸Áî, °üÀ¨integer·µ»ØÀ´´¦ÀíµÄ¡£booleanÐ͵ÄÊý×éÔòÊÇÓÃbyteÊý×éÀ´´¦ÀíµÄ¡£
ÐéÄâ»úʹÓÃIEEE754¸ñʽµÄ¸¡µãÊý¡£²»Ö§³ÖIEEE¸ñʽµÄ½Ï¾ÉµÄ¼ÆËã»ú,ÔÚÔËÐÐJavaÊýÖµ¼ÆËã³ÌÐòʱ,¿ÉÄÜ»á·Ç³£Âý¡£
ÐéÄâ»úÖ§³ÖµÄÆäËüÊý¾ÝÀàÐÍ°üÀ¨:

object//¶ÔÒ»¸öJavaobject(¶ÔÏó)µÄ4×Ö½ÚÒýÓà returnAddress//4×Ö½Ú,ÓÃÓÚjsr/ret/jsr-w/ret-wÖ¸Áî

×¢:JavaÊý×é±»µ±×÷object´¦Àí¡£
ÐéÄâ»úµÄ¹æ·¶¶ÔÓÚobjectÄÚ²¿µÄ½á¹¹Ã»ÓÐÈκÎÌØÊâµÄÒªÇó¡£ÔÚSun¹«Ë¾µÄʵÏÖÖÐ,¶Ô objectµÄÒýÓÃÊÇÒ»¸ö¾ä±ú,ÆäÖаüº¬Ò»¶ÔÖ¸Õë:Ò»¸öÖ¸ÕëÖ¸Ïò¸ÃobjectµÄ·½·¨±í,ÁíÒ»¸öÖ¸Ïò ¸ÃobjectµÄÊý¾Ý¡£
ÓÃJavaÐéÄâ»úµÄ×Ö½ÚÂë±íʾµÄ³ÌÐòÓ¦¸Ã×ñÊØÀàÐ͹涨¡£JavaÐéÄâ»úµÄʵÏÖÓ¦¾Ü¾øÖ´ÐÐÎ¥·´ÁËÀàÐ͹涨µÄ×Ö½ÚÂë³ÌÐò¡£
JavaÐéÄâ»úÓÉÓÚ×Ö½ÚÂ붨ÒåµÄÏÞÖÆËƺõÖ»ÄÜÔËÐÐÓÚ32λµØÖ·¿Õ¼äµÄ»úÆ÷ÉÏ¡£µ«ÊÇ¿ÉÒÔ´´½¨Ò»¸öJavaÐéÄâ»ú,Ëü×Ô¶¯µØ°Ñ×Ö½ÚÂëת»»³É64λµÄÐÎʽ¡£
´ÓJavaÐéÄâ»úÖ§³ÖµÄÊý¾ÝÀàÐÍ¿ÉÒÔ¿´³ö,Java¶ÔÊý¾ÝÀàÐ͵ÄÄÚ²¿¸ñʽ½øÐÐÁËÑϸñ¹æ¶¨,ÕâÑùʹµÃ¸÷ÖÖJavaÐéÄâ»úµÄʵÏÖ¶ÔÊý¾ÝµÄ½âÊÍÊÇÏàͬµÄ,´Ó¶ø±£Ö¤ÁËJavaµÄÓëƽ̨ÎÞ¹ØÐԺͿÉÒÆÖ²ÐÔ¡£
¶þ¡¢ JavaÐéÄâ»úÌåϵ½á¹¹

JavaÐéÄâ»úÓÉÎå¸ö²¿·Ö×é³É:Ò»×éÖ¸Á¡¢Ò»×é¼Ä´æÆ÷¡¢Ò»¸öÕ»¡¢Ò»¸öÎÞÓõ¥ÔªÊÕ¼¯¶Ñ(Garbage-collected-heap)¡¢Ò»¸ö·½·¨ÇøÓò¡£ÕâÎ岿·ÖÊÇJavaÐéÄâ»úµÄÂß¼­³É·Ý,²»ÒÀÀµ ÈκÎʵÏÖ¼¼Êõ»ò×éÖ¯·½Ê½,µ«ËüÃǵŦÄܱØÐëÔÚÕæʵ»úÆ÷ÉÏÒÔijÖÖ·½Ê½ÊµÏÖ¡£

JavaÖ¸Á
JavaÐéÄâ»úÖ§³Ö´óÔ¼248¸ö×Ö½ÚÂ롣ÿ¸ö×Ö½ÚÂëÖ´ÐÐÒ»ÖÖ»ù±¾µÄCPUÔËËã,ÀýÈç,°ÑÒ»¸öÕûÊý¼Óµ½¼Ä´æÆ÷,×Ó³ÌÐòתÒƵȡ£JavaÖ¸ÁÏ൱ÓÚJava³ÌÐòµÄ»ã±àÓïÑÔ¡£
JavaÖ¸ÁÖеÄÖ¸Áî°üº¬Ò»¸öµ¥×ֽڵIJÙ×÷·û,ÓÃÓÚÖ¸¶¨ÒªÖ´ÐеIJÙ×÷,»¹ÓÐ0¸ö»ò¶à¸ö²Ù×÷Êý,Ìṩ²Ù×÷ËùÐèµÄ²ÎÊý»òÊý¾Ý¡£Ðí¶àÖ¸ÁîûÓвÙ×÷Êý,½öÓÉÒ»¸öµ¥×ֽڵIJÙ×÷·û¹¹³É¡£ÐéÄâ»úµÄÄÚ²ãÑ­»·µÄÖ´Ðйý³ÌÈçÏÂ:
do{ È¡Ò»¸ö²Ù×÷·û×Ö½Ú; ¸ù¾Ý²Ù×÷·ûµÄÖµÖ´ÐÐÒ»¸ö¶¯×÷; }while(³ÌÐòδ½áÊø)

ÓÉÓÚÖ¸ÁîϵͳµÄ¼òµ¥ÐÔ,ʹµÃÐéÄâ»úÖ´ÐеĹý³ÌÊ®·Ö¼òµ¥,´Ó¶øÓÐÀûÓÚÌá¸ßÖ´ÐеÄЧÂÊ¡£
Ö¸ÁîÖвÙ×÷ÊýµÄÊýÁ¿ºÍ´óСÊÇÓɲÙ×÷·û¾ö¶¨µÄ¡£Èç¹û²Ù×÷Êý±ÈÒ»¸ö×Ö½Ú´ó,ÄÇôËü´æ´¢µÄ˳ÐòÊǸßλ×Ö½ÚÓÅÏÈ¡£ÀýÈç,Ò»¸ö16λµÄ²ÎÊý´æ·ÅʱռÓÃÁ½¸ö×Ö½Ú,ÆäֵΪ: µÚÒ»¸ö×Ö½Ú*256+µÚ¶þ¸ö×Ö½Ú
×Ö½ÚÂëÖ¸ÁîÁ÷Ò»°ãÖ»ÊÇ×Ö½Ú¶ÔÆëµÄ¡£Ö¸ÁîtableswitchºÍlookupÊÇÀýÍâ,ÔÚÕâÁ½ÌõÖ¸ÁîÄÚ²¿ ÒªÇóÇ¿ÖƵÄ4×ֽڱ߽ç¶ÔÆë¡£

¼Ä´æÆ÷
JavaÐéÄâ»úµÄ¼Ä´æÆ÷ÓÃÓÚ±£´æ»úÆ÷µÄÔËÐÐ״̬,Óë΢´¦ÀíÆ÷ÖеÄijЩרÓüĴæÆ÷ÀàËÆ¡£ JavaÐéÄâ»úµÄ¼Ä´æÆ÷ÓÐËÄÖÖ:
pc:Java³ÌÐò¼ÆÊýÆ÷¡£ optop:Ö¸Ïò²Ù×÷ÊýÕ»¶¥¶ËµÄÖ¸Õë¡£ frame:Ö¸Ïòµ±Ç°Ö´Ðз½·¨µÄÖ´Ðл·¾³µÄÖ¸Õë¡£ vars:Ö¸Ïòµ±Ç°Ö´Ðз½·¨µÄ¾Ö²¿±äÁ¿ÇøµÚÒ»¸ö±äÁ¿µÄÖ¸Õë¡£


JavaÐéÄâ»ú
JavaÐéÄâ»úÊÇջʽµÄ,Ëü²»¶¨Òå»òʹÓüĴæÆ÷À´´«µÝ»ò½ÓÊܲÎÊý,ÆäÄ¿µÄÊÇΪÁ˱£Ö¤Ö¸ÁµÄ¼ò½àÐÔºÍʵÏÖʱµÄ¸ßЧÐÔ(ÌرðÊǶÔÓڼĴæÆ÷ÊýÄ¿²»¶àµÄ´¦ÀíÆ÷)¡£ËùÓмĴæÆ÷¶¼ÊÇ32λµÄ¡£

Õ»
JavaÐéÄâ»úµÄÕ»ÓÐÈý¸öÇøÓò:¾Ö²¿±äÁ¿Çø¡¢ÔËÐл·¾³Çø¡¢²Ù×÷ÊýÇø¡£
¾Ö²¿±äÁ¿Çø¡¡
ÿ¸öJava·½·¨Ê¹ÓÃÒ»¸ö¹Ì¶¨´óСµÄ¾Ö²¿±äÁ¿¼¯¡£ËüÃÇ°´ÕÕÓëvars¼Ä´æÆ÷µÄ×ÖÆ«ÒÆÁ¿À´Ñ°Ö·¡£¾Ö²¿±äÁ¿¶¼ÊÇ32λµÄ¡£³¤ÕûÊýºÍË«¾«¶È¸¡µãÊýÕ¼¾ÝÁËÁ½¸ö¾Ö²¿±äÁ¿µÄ¿Õ¼ä,È´°´ÕÕµÚÒ»¸ö¾Ö²¿±äÁ¿µÄË÷ÒýÀ´Ñ°Ö·¡£(ÀýÈç,Ò»¸ö¾ßÓÐË÷ÒýnµÄ¾Ö²¿±äÁ¿,Èç¹ûÊÇÒ»¸öË«¾«¶È¸¡µãÊý,ÄÇôËüʵ¼ÊÕ¼¾ÝÁËË÷Òý nºÍn+1Ëù´ú±íµÄ´æ´¢¿Õ¼ä¡£)ÐéÄâ»ú¹æ·¶²¢²»ÒªÇóÔÚ¾Ö²¿±äÁ¿ÖеÄ64λµÄÖµÊÇ64λ¶ÔÆëµÄÐéÄâ»úÌṩÁ˰Ѿֲ¿±äÁ¿ÖеÄÖµ×°Ôص½²Ù×÷ÊýÕ»µÄÖ¸Áî,Ò²ÌṩÁ˰ѲÙ×÷ÊýÕ»ÖеÄֵдÈë¾Ö²¿±äÁ¿µÄÖ¸Áî¡£
ÔËÐл·¾³Çø
¡¡ÔÚÔËÐл·¾³Öаüº¬µÄÐÅÏ¢ÓÃÓÚ¶¯Ì¬Á´½Ó,Õý³£µÄ·½·¨·µ»ØÒÔ¼°Òì³£´«²¥¡£
¶¯Ì¬Á´½Ó
ÔËÐл·¾³°üÀ¨¶ÔÖ¸Ïòµ±Ç°ÀàºÍµ±Ç°·½·¨µÄ½âÊÍÆ÷·ûºÅ±íµÄÖ¸Õë,ÓÃÓÚÖ§³Ö·½·¨´úÂëµÄ¶¯Ì¬Á´½Ó¡£·½·¨µÄclassÎļþ´úÂëÔÚÒýÓÃÒªµ÷Óõķ½·¨ºÍÒª·ÃÎʵıäÁ¿Ê±Ê¹Ó÷ûºÅ¡£¶¯Ì¬Á´½Ó°Ñ·ûºÅÐÎʽµÄ·½·¨µ÷Ó÷­Òë³Éʵ¼Ê·½·¨µ÷ÓÃ,×°ÔرØÒªµÄÀàÒÔ½âÊÍ»¹Ã»Óж¨ÒåµÄ·ûºÅ, ²¢°Ñ±äÁ¿·ÃÎÊ·­Òë³ÉÓëÕâЩ±äÁ¿ÔËÐÐʱµÄ´æ´¢½á¹¹ÏàÓ¦µÄÆ«ÒƵØÖ·¡£¶¯Ì¬Á´½Ó·½·¨ºÍ±äÁ¿Ê¹µÃ·½·¨ÖÐʹÓõÄÆäËüÀàµÄ±ä»¯²»»áÓ°Ïìµ½±¾³ÌÐòµÄ´úÂë¡£
Õý³£µÄ·½·¨·µ»Ø
Èç¹ûµ±Ç°·½·¨Õý³£µØ½áÊøÁË,ÔÚÖ´ÐÐÁËÒ»Ìõ¾ßÓÐÕýÈ·ÀàÐ͵ķµ»ØÖ¸Áîʱ,µ÷Óõķ½·¨»áµÃµ½Ò»¸ö·µ»ØÖµ¡£
Ö´Ðл·¾³ÔÚÕý³£·µ»ØµÄÇé¿öÏÂÓÃÓÚ»Ö¸´µ÷ÓÃÕߵļĴæÆ÷,²¢°Ñµ÷ÓÃÕߵijÌÐò¼ÆÊýÆ÷Ôö¼ÓÒ»¸öÇ¡µ±µÄÊýÖµ,ÒÔÌø¹ýÒÑÖ´ÐйýµÄ·½·¨µ÷ÓÃÖ¸Áî,È»ºóÔÚµ÷ÓÃÕßµÄÖ´Ðл·¾³ÖмÌÐøÖ´ÐÐÏÂÈ¥¡£

Òì³£ºÍ´íÎó´«²¥
Òì³£Çé¿öÔÚJavaÖб»³Æ×÷Error(´íÎó)»òException(Òì³£),ÊÇThrowableÀàµÄ×ÓÀà,ÔÚ³ÌÐòÖгö´íµÄÔ­ÒòÊÇ:¢Ù¶¯Ì¬Á´½Ó´í,ÈçÎÞ·¨ÕÒµ½ËùÐèµÄclassÎļþ¡£¢ÚÔËÐÐʱ´í,Èç¶ÔÒ»¸ö¿ÕÖ¸ÕëµÄÒýÓÃ

³ÌÐòʹÓÃÁËthrowÓï¾ä¡£
µ±Òì³£·¢Éúʱ,JavaÐéÄâ»ú²ÉÈ¡ÈçÏ´ëÊ©:
¼ì²éÓ뵱ǰ·½·¨ÏàÁªÏµµÄcatch×Ó¾ä±í¡£Ã¿¸öcatch×Ó¾ä°üº¬ÆäÓÐЧָÁΧ,Äܹ»´¦ÀíµÄÒì³£ÀàÐÍ,ÒÔ¼°´¦ÀíÒì³£µÄ´úÂë¿éµØÖ·¡£
ÓëÒì³£ÏàÆ¥ÅäµÄcatch×Ó¾äÓ¦¸Ã·ûºÏÏÂÃæµÄÌõ¼þ:Ôì³ÉÒì³£µÄÖ¸ÁîÔÚÆäÖ¸ÁΧ֮ÄÚ ,·¢ÉúµÄÒì³£ÀàÐÍÊÇÆäÄÜ´¦ÀíµÄÒì³£ÀàÐ͵Ä×ÓÀàÐÍ¡£Èç¹ûÕÒµ½ÁËÆ¥ÅäµÄcatch×Ó¾ä,ÄÇôϵͳתÒƵ½Ö¸¶¨µÄÒì³£´¦Àí¿é´¦Ö´ÐÐ;Èç¹ûûÓÐÕÒµ½Òì³£´¦Àí¿é,Öظ´Ñ°ÕÒÆ¥ÅäµÄcatch×Ó¾äµÄ¹ý³Ì,Ö±µ½µ±Ç°·½·¨µÄËùÓÐǶÌ×µÄcatch×Ӿ䶼±»¼ì²é¹ý¡£
ÓÉÓÚÐéÄâ»ú´ÓµÚÒ»¸öÆ¥ÅäµÄcatch×Ӿ䴦¼ÌÐøÖ´ÐÐ,ËùÒÔcatch×Ó¾ä±íÖеÄ˳ÐòÊǺÜÖØÒªµÄ¡£ÒòΪJava´úÂëÊǽṹ»¯µÄ,Òò´Ë×Ü¿ÉÒÔ°Ñij¸ö·½·¨µÄËùÓеÄÒì³£´¦ÀíÆ÷¶¼°´ÐòÅÅÁе½Ò»¸ö±íÖÐ,¶ÔÈÎÒâ¿ÉÄܵijÌÐò¼ÆÊýÆ÷µÄÖµ,¶¼¿ÉÒÔÓÃÏßÐÔµÄ˳ÐòÕÒµ½ºÏÊʵÄÒì³£´¦Àí¿é,ÒÔ´¦ÀíÔڸóÌÐò¼ÆÊýÆ÷ֵϷ¢ÉúµÄÒì³£Çé¿ö¡£
Èç¹ûÕÒ²»µ½Æ¥ÅäµÄcatch×Ó¾ä,ÄÇôµ±Ç°·½·¨µÃµ½Ò»¸ö"δ½Ø»ñÒì³£"µÄ½á¹û²¢·µ»Øµ½µ±Ç°·½·¨µÄµ÷ÓÃÕß,ºÃÏñÒì³£¸Õ¸ÕÔÚÆäµ÷ÓÃÕßÖз¢ÉúÒ»Ñù¡£Èç¹ûÔÚµ÷ÓÃÕßÖÐÈÔȻûÓÐÕÒµ½ÏàÓ¦µÄÒì³£´¦Àí,ÄÇôϵ ͳ½«µ÷ÓÃÒ»¸öȱʡµÄÒì³£´¦Àí¿é¡£
²Ù×÷ÊýÕ»Çø¡¡
»úÆ÷Ö¸ÁîÖ»´Ó²Ù×÷ÊýÕ»ÖÐÈ¡²Ù×÷Êý,¶ÔËüÃǽøÐвÙ×÷,²¢°Ñ½á¹û·µ»Øµ½Õ»ÖС£Ñ¡ÔñÕ»½á¹¹µÄÔ­ÒòÊÇ:ÔÚÖ»ÓÐÉÙÁ¿¼Ä´æÆ÷»ò·ÇͨÓüĴæÆ÷µÄ»úÆ÷(ÈçIntel486)ÉÏ,Ò²Äܹ»¸ßЧµØÄ£ÄâÐéÄâ»úµÄÐÐΪ¡£
²Ù×÷ÊýÕ»ÊÇ32λµÄ¡£ËüÓÃÓÚ¸ø·½·¨´«µÝ²ÎÊý,²¢´Ó·½·¨½ÓÊÕ½á¹û,Ò²ÓÃÓÚÖ§³Ö²Ù×÷µÄ²ÎÊý,²¢±£´æ²Ù×÷µÄ½á¹û¡£
ÀýÈç,iaddÖ¸ÁÁ½¸öÕûÊýÏà¼Ó¡£Ïà¼ÓµÄÁ½¸öÕûÊýÓ¦¸ÃÊDzÙ×÷ÊýÕ»¶¥µÄÁ½¸ö×Ö¡£ÕâÁ½¸ö×ÖÊÇÓÉÏÈÇ°µÄÖ¸Áîѹ½ø¶ÑÕ»µÄ¡£ÕâÁ½¸öÕûÊý½«´Ó¶ÑÕ»µ¯³ö¡¢Ïà¼Ó,²¢°Ñ½á¹ûѹ»Øµ½²Ù×÷ÊýÕ»ÖС£Ã¿¸öԭʼÊý¾ÝÀàÐͶ¼ÓÐרÃŵÄÖ¸Áî¶ÔËüÃǽøÐбØÐëµÄ²Ù×÷¡£Ã¿¸ö²Ù×÷ÊýÔÚÕ»ÖÐÐèÒªÒ»¸ö´æ´¢Î»ÖÃ,³ýÁËlongºÍdouble ÐÍ,ËüÃÇÐèÒªÁ½¸öλÖá£
²Ù×÷ÊýÖ»Äܱ»ÊÊÓÃÓÚÆäÀàÐ͵IJÙ×÷·ûËù²Ù×÷¡£ÀýÈç,ѹÈëÁ½¸öintÀàÐ͵ÄÊý,Èç¹û°ÑËüÃǵ±×÷ÊÇÒ»¸ölongÀàÐ͵ÄÊýÔòÊÇ·Ç·¨µÄ¡£ÔÚSunµÄÐéÄâ»úʵÏÖÖÐ,Õâ¸öÏÞÖÆÓÉ×Ö½ÚÂëÑéÖ¤Æ÷Ç¿ÖÆʵÐС£µ«ÊÇ,ÓÐÉÙÊý²Ù×÷(²Ù×÷·ûdupeºÍswap),ÓÃÓÚ¶ÔÔËÐÐʱÊý¾ÝÇø½øÐвÙ×÷ʱÊDz»¿¼ÂÇÀàÐ͵ġ£
ÎÞÓõ¥ÔªÊÕ¼¯¶Ñ
JavaµÄ¶ÑÊÇÒ»¸öÔËÐÐʱÊý¾ÝÇø,ÀàµÄʵÀý(¶ÔÏó)´ÓÖзÖÅä¿Õ¼ä¡£JavaÓïÑÔ¾ßÓÐÎÞÓõ¥ÔªÊÕ¼¯ÄÜÁ¦:Ëü²»¸ø³ÌÐòÔ±ÏÔʽÊͷŶÔÏóµÄÄÜÁ¦¡£Java²»¹æ¶¨¾ßÌåʹÓõÄÎÞÓõ¥ÔªÊÕ¼¯Ëã·¨,¿ÉÒÔ¸ù¾ÝϵͳµÄÐèÇóʹÓø÷ÖÖ¸÷ÑùµÄËã·¨¡£

·½·¨Çø
·½·¨ÇøÓ봫ͳÓïÑÔÖеıàÒëºó´úÂë»òÊÇUnix½ø³ÌÖеÄÕýÎĶÎÀàËÆ¡£Ëü±£´æ·½·¨´úÂë (±àÒëºóµÄjava´úÂë)ºÍ·ûºÅ±í¡£ÔÚµ±Ç°µÄJavaʵÏÖÖÐ,·½·¨´úÂë²»°üÀ¨ÔÚÎÞÓõ¥ÔªÊÕ¼¯¶ÑÖÐ,µ«¼Æ»®ÔÚ½«À´µÄ°æ±¾ÖÐʵÏÖ¡£Ã¿¸öÀàÎļþ°üº¬ÁËÒ»¸ö JavaÀà»òÒ»¸öJava½çÃæµÄ±àÒëºóµÄ´úÂë¡£¿ÉÒÔ˵ÀàÎļþÊÇ JavaÓïÑÔµÄÖ´ÐдúÂëÎļþ¡£ÎªÁ˱£Ö¤ÀàÎļþµÄƽ̨ÎÞ¹ØÐÔ,JavaÐéÄâ»ú¹æ·¶ÖжÔÀàÎļþµÄ¸ñʽҲ×÷ÁËÏêϸµÄ˵Ã÷¡£Æä¾ßÌåϸ½ÚÇë²Î¿¼Sun¹«Ë¾µÄJava ÐéÄâ»ú¹æ·¶
Èý¡¢ JavaÀàÎļþ(.classÎļþ)

ÿ¸öÀàÎļþ°üº¬ÁËÒ»¸öJavaÀà»òÒ»¸öJava½çÃæµÄ±àÒëºóµÄ´úÂë¡£¿ÉÒÔ˵ÀàÎļþÊÇJavaÓïÑÔµÄÖ´ÐдúÂëÎļþ¡£ÎªÁ˱£Ö¤ÀàÎļþµÄƽ̨ÎÞ¹ØÐÔ,JavaÐéÄâ»ú¹æ·¶ÖжÔÀàÎļþµÄ¸ñʽҲ×÷ÁËÏêϸµÄ˵Ã÷¡£Æä¾ßÌåϸ½ÚÇë²Î¿¼Sun¹«Ë¾µÄJavaÐéÄâ»ú¹æ·¶¡£

ËÄ¡¢ JavaоƬ

ÓÉÓÚJavaÓïÑÔÊǽâÊÍÐÍÓïÑÔ,ÔÚÒ»°ãµÄͨÓô¦ÀíÆ÷ÉÏÆäÔËÐÐËٶȱÈÆð±àÒëÐÍÓïÑÔÒªÂýºÜ¶à¡£Sun¹«Ë¾ÎªÁ˽øÒ»²½ÍƹãJavaµÄÓ¦ÓÃ,ÍƳöÁË JavaоƬ¡£ÕâЩоƬ¿ÉÒÔ˵ÊÇJavaÐéÄâ»úµÄÓ²¼þʵÏÖ¡£ÓëͨÓÃоƬºÍ½âÊÍÆ÷¹¹³ÉµÄÐéÄâ»ú²»Í¬,JavaоƬ¿ÉÒÔÖ±½ÓÖ´ÐÐ×Ö½ÚÂë,Ò²¾ÍÊÇ˵,×Ö½ÚÂë¾ÍÊÇ JavaоƬµÄÖ¸Á¡£ÕâÖÖÓÃÓ²¼þʵÏÖµÄÐéÄâ»úµ±È»Òª±ÈÈí¼þÄ£ÄâµÄÐéÄâ»úµÄËÙ¶ÈÒª¿ìµÃ¶à¡£
Sun¹«Ë¾¼Æ»®ÍƳöµÄJavaоƬÓÐÈýÖÖ:picoJava,mi-croJavaºÍultraJava¡£

picoJavaÊÇÒ»¸öºÜСµÄJavaÄÚºËоƬ,Æä¹èƬÃæ»ýÖ»ÓÐ25mm2¡£Sun¹«Ë¾×¼±¸ÏòÆäËü¹«Ë¾×ªÈÃ,ÒÔ±ãÆäËü¹«Ë¾¿ÉÒÔ¶¨ÖÆ×Ô¼ºµÄJavaоƬ,ÆäµÍ¶Ë²úÆ·µÄÊÛ¼Û¹À¼Æ²»µ½25ÃÀÔª¡£
microJavaÊÇ»ùÓÚpicoJavaµÄ΢¿ØÖÆÆ÷оƬ,ÆäоƬÃæ»ýԼΪ50mm2,ÓÃÓÚͨÐÅÉ豸ºÍÆäËüǶÈëʽ¿ØÖÆÉ豸¡£Sun¹«Ë¾Ï£ÍûJavaоƬ¿ÉÒÔ³ÉΪÍƶ¯Java·¢Õ¹µÄÖ÷Òª¼¼ÊõÖ®Ò»¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ