linuxÖÐjstackÏÂÁî²»¿ÉÓÃÁËÔõô°ì
linuxÖÐjstackÏÂÁî²»¿ÉÓÃÁË£¬½â¾öÒªÁìÊÇ£º1¡¢×¼È·×°ÖÃjdk£¬²¢ÉèÖÃÇéÐαäÁ¿£»2¡¢È·±£¡°java_home¡±ºÍ¡°path¡±ÇéÐαäÁ¿¶¼×¼È·ÉèÖã»3¡¢È·ÈÏjstackÏÂÁîËùÔڵķ¾¶ÒÑÌí¼Óµ½ÏµÍ³µÄ¿ÉÖ´Ðз¾¶ÖУ»4¡¢Ê¹ÓõÄjdk°æ±¾ÓëÕýÔÚÔËÐеÄjavaÀú³ÌµÄ°æÄÚÇéÆ¥Å䣻5¡¢ÊµÑéʹÓÃrootÓû§»òÒÔÖÎÀíÔ±Éí·ÝÔËÐÐÏÂÁî¡£
±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£
ÔÚ Linux ÖÐ jstack ÏÂÁîÎÞ·¨Ê¹Ó㬿ÉÄÜÊÇÓÉÓÚÒÔÏÂÔµ¹ÊÔÓÉÖ®Ò»£º
Java Development Kit (JDK) δ׼ȷװÖãºjstack ÊÇ JDK ÖеÄÒ»²¿·Ö£¬ÈôÊÇÄãûÓÐ׼ȷװÖà JDK »òÕßʹÓõÄÊÇ JRE (Java Runtime Environment)£¬ÔòÎÞ·¨Ê¹Óà jstack ÏÂÁȷ±£ÒѾ׼ȷװÖÃÁË JDK£¬²¢ÇÒÉèÖÃÁË׼ȷµÄÇéÐαäÁ¿¡£
ÇéÐαäÁ¿ÉèÖùýʧ£º¼ì²éÄãµÄÇéÐαäÁ¿ÉèÖÃÊÇ·ñ׼ȷ¡£È·±£ JAVA_HOME ºÍ PATH ÇéÐαäÁ¿¶¼×¼È·ÉèÖá£JAVA_HOME ±äÁ¿Ó¦¸ÃÖ¸Ïò JDK µÄ×°ÖÃĿ¼£¬¶ø PATH ±äÁ¿Ó¦¸Ã°üÀ¨ JDK µÄ bin Ŀ¼¡£
jstack ²»ÔÚϵͳµÄ¿ÉÖ´Ðз¾¶ÖУºÈ·ÈÏ jstack ÏÂÁîËùÔڵķ¾¶ÊÇ·ñÒÑÌí¼Óµ½ÏµÍ³µÄ¿ÉÖ´Ðз¾¶ÖС£Äã¿ÉÒÔʵÑéʹÓþø¶Ô·¾¶À´ÔËÐÐ jstack ÏÂÁÀýÈç /path/to/jdk/bin/jstack¡£
JDK °æ±¾²»Æ¥Å䣺ÈôÊÇ jstack ÏÂÁî¿ÉÓõ«²»Æð×÷Ó㬿ÉÄÜÊÇÓÉÓÚ JDK °æ±¾²»¼æÈÝ¡£È·±£ÄãÕýÔÚʹÓÃµÄ JDK °æ±¾ÓëÄãÕýÔÚÔËÐÐµÄ Java Àú³ÌµÄ°æÄÚÇéÆ¥Åä¡£
ϵͳȨÏÞÏÞÖÆ£ºÄ³Ð©ÇéÐÎÏ£¬Óû§È¨ÏÞÏÞÖÆ¿ÉÄܻᵼÖÂÎÞ·¨Ê¹Óà jstack ÏÂÁȷ±£Äã¾ßÓÐ×ã¹»µÄȨÏÞÀ´ÔËÐÐ jstack ÏÂÁî¡£¿ÉÒÔʵÑéʹÓà root Óû§»òÒÔÖÎÀíÔ±Éí·ÝÔËÐÐÏÂÁî¡£
ÈôÊÇÒÔÉÏÒªÁ춼ÎÞ·¨½â¾öÎÊÌ⣬½¨ÒéÌṩ¸ü¶àÏêϸÐÅÏ¢¡¢¹ýʧÌáÐÑ»òÏÂÁîʹÓÃÇéÐΣ¬ÒÔ±ã¾ÙÐиü½øÒ»²½µÄÆÊÎöºÍ×ÊÖú¡£
ÒÔÉϾÍÊÇlinuxÖÐjstackÏÂÁî²»¿ÉÓÃÁËÔõô°ìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡