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

linuxÔõôÉèÖÃjdkÇéÐÎ

ÒªÔÚ linux ÉÏÉèÖà jdk ÇéÐΣ¬ÐèÒª£ºÏÂÔØ jdk ²¢½âѹ£»ÉèÖà java_home ÇéÐαäÁ¿£»ÉèÖà path ÇéÐαäÁ¿£»Ñé֤װÖ㻣¨¿ÉÑ¡£©ÉèÖÃĬÈÏ jdk£»£¨¿ÉÑ¡£©¸üÐÂϵͳ±äÁ¿¡£

ÔõÑùÔÚ Linux ÉÏÉèÖà JDK ÇéÐÎ

°ì·¨ 1£ºÏÂÔØ JDK

»á¼û Oracle ¹Ù·½ÍøÕ¾²¢ÏÂÔØÓëÄúµÄ²Ù×÷ϵͳºÍ¼Ü¹¹¼æÈÝµÄ JDK¡£

½âѹÏÂÔصÄѹËõÎļþÖÁËùÐèλÖã¬ÀýÈç /usr/java¡£

°ì·¨ 2£ºÉèÖà JAVA_HOME

·­¿ªÖն˻òÎı¾±à¼­Æ÷¡£

½¨Éè»ò±à¼­ /etc/profile »ò /etc/environment Îļþ¡£

Ìí¼ÓÒÔÏÂÐУº

export JAVA_HOME=/usr/java/jdk-version

µÇ¼ºó¸´ÖÆ

Ìæ»» jdk-version ΪÏÖʵµÄ JDK °æ±¾£¬ÀýÈç jdk11¡£

°ì·¨ 3£ºÉèÖà PATH

ÔÚ /etc/profile »ò /etc/environment ÎļþÖÐÌí¼ÓÒÔÏÂÐУº

export PATH=$PATH:$JAVA_HOME/bin

µÇ¼ºó¸´ÖÆ

Õ⽫°Ñ JDK µÄ bin Ŀ¼Ìí¼Óµ½ÄúµÄϵͳ·¾¶ÖС£

°ì·¨ 4£ºÑé֤װÖÃ

ÔÚÖÕ¶ËÖÐÔËÐÐÒÔÏÂÏÂÁ

java -version

µÇ¼ºó¸´ÖÆ

ÄúÓ¦¸Ã¿´µ½ÒÑ×°ÖÃµÄ JDK °æ±¾¡£

°ì·¨ 5£ºÉèÖÃĬÈÏ JDK£¨¿ÉÑ¡£©

ÈôÊÇÄúÓжà¸ö JDK °æ±¾ÒÑ×°Öã¬Ôò¿ÉÒÔÉèÖÃÒ»¸ö×÷ΪϵͳĬÈÏÖµ¡£

ÔËÐÐÒÔÏÂÏÂÁ

sudo update-alternatives --install /usr/bin/java java /usr/java/jdk-version/bin/java 100

µÇ¼ºó¸´ÖÆ

½« jdk-version ²¿·ÖÌ滻ΪÄúÒªÉèÖÃΪĬÈÏÖµµÄ°æ±¾¡£

°ì·¨ 6£º¸üÐÂϵͳ±äÁ¿£¨¿ÉÑ¡£©

ÈôÊÇÄú¶Ôϵͳ±äÁ¿¾ÙÐÐÁËÐ޸ģ¬ÇëÔËÐÐÒÔÏÂÏÂÁ

source /etc/profile

µÇ¼ºó¸´ÖÆ

»ò

source /etc/environment

µÇ¼ºó¸´ÖÆ

ÒÔÓ¦Óøü¸Ä¡£

×¢ÖØ£º

È·±£Ê¹ÓÃÓë JDK °æ±¾Æ¥ÅäµÄ jdk-version¡£

ƾ֤ÄúµÄ Linux ¿¯Ðа棬ijЩ°ì·¨¿ÉÄÜÂÔÓвî±ð¡£

ÒÔÉϾÍÊÇlinuxÔõôÉèÖÃjdkÇéÐεÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ