×ðÁú¿­Ê±¹ÙÍøµÇ¼

linuxÔõôÉó²éjdk°æ±¾

ÔÚ linux ÖÐÉó²é jdk °æ±¾µÄÒªÁìÓУºÔËÐÐ “java -version” ÏÂÁî¡£ÔËÐÐ “javac -version” ÏÂÁ½öÊÊÓÃÓÚÒÑ×°Öà jdk µÄϵͳ£©¡£¼ì²é “/usr/lib/jvm” Ŀ¼ÖеÄÎļþ¡£Ê¹Óà “which java” ÏÂÁî²éÕÒ java ÏÂÁîµÄ·¾¶¡£Ê¹Óà “env | grep java_home” ÏÂÁîÉó²é java_home ÇéÐαäÁ¿¡£¹ØÓÚʹÓà update-alternatives ÖÎÀí java ×°ÖõÄϵͳ £¬ÔËÐÐ “update-alternatives

ÔõÑùÔÚ Linux ÖÐÉó²é JDK °æ±¾

ÔÚ Linux ϵͳÖÐÉó²éÒÑ×°ÖÃµÄ JDK °æ±¾ÓÐÒÔϼ¸ÖÖÒªÁ죺

1. Java -version ÏÂÁî

ÕâÊÇ×î³£¼ûµÄÏÂÁî £¬ËüÖ±½ÓÏÔʾ Java ÔËÐÐʱÇéÐÎ (JRE) ºÍ Java ¿ª·¢¹¤¾ß°ü (JDK) µÄ°æ±¾¡£

java -version

µÇ¼ºó¸´ÖÆ

2. javac -version ÏÂÁî

´ËÏÂÁî½öÊÊÓÃÓÚÒÑ×°Öà JDK µÄϵͳ £¬ËüÏÔʾ Java ±àÒëÆ÷µÄ°æ±¾ £¬¸Ã±àÒëÆ÷ÊÇ JDK µÄÒ»²¿·Ö¡£

javac -version

µÇ¼ºó¸´ÖÆ

3. ¼ì²éÎļþϵͳ

ÔÚ Ubuntu ϵͳÖÐ £¬Ä¬ÈÏÇéÐÎÏ £¬JDK ×°ÖÃÔÚ /usr/lib/jvm Ŀ¼Ï¡£Äú¿ÉÒÔÉó²é¸ÃĿ¼ÒÔÉó²éÒÑ×°ÖÃµÄ JDK °æ±¾£º

ls /usr/lib/jvm

µÇ¼ºó¸´ÖÆ

4. ʹÓà which ÏÂÁî²éÕÒ Java ÏÂÁî

which ÏÂÁî¿ÉÒÔÕÒµ½ Java ÏÂÁîµÄ·¾¶ £¬ÆäÖаüÀ¨ JDK °æ±¾ÐÅÏ¢£º

which java

µÇ¼ºó¸´ÖÆ

5. env ÏÂÁî

env ÏÂÁî¿ÉÒÔÏÔʾϵͳÇéÐαäÁ¿ £¬ÆäÖпÉÄÜ°üÀ¨ JAVA_HOME ±äÁ¿ £¬¸Ã±äÁ¿Ö¸Ïò JDK µÄ×°ÖÃĿ¼¡£

env | grep JAVA_HOME

µÇ¼ºó¸´ÖÆ

6. update-alternatives ÏÂÁî

¹ØÓÚʹÓà update-alternatives ÖÎÀí Java ×°ÖõÄϵͳ £¬Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²éÄ¿½ñµÄ JDK °æ±¾£º

update-alternatives --query java

µÇ¼ºó¸´ÖÆ

ͨ¹ýʹÓÃÉÏÊöÒªÁìÖеÄÈκÎÒ»ÖÖ £¬Äú¶¼¿ÉÒÔÇáËɵØÔÚ Linux ϵͳÖÐÈ·¶¨ÒÑ×°ÖÃµÄ JDK °æ±¾¡£

ÒÔÉϾÍÊÇlinuxÔõôÉó²éjdk°æ±¾µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ