´î½¨gitÌáÐÑjava¼ÓÔØʧ°ÜÔõô°ì
Ëæ×ÅÈí¼þ¿ª·¢µÄѸÃÍÉú³¤£¬git×÷Ϊһ¿îÂþÑÜʽ°æ±¾¿ØÖÆϵͳÒѾ³ÉΪÐí¶à¿ª·¢Ö°Ô±ºÍÍŶӲ»¿É»òȱµÄ¹¤¾ß¡£¿ÉÊÇ£¬Ôڴgitʱ£¬ÓÐʱ»áÓöµ½Ò»Ð©ÎÊÌ⣬ºÃ±Èjava¼ÓÔØʧ°ÜµÄ¹ýʧÌáÐÑ¡£±¾ÎĽ«ÏÈÈÝÕâ¸öÎÊÌâµÄÔµ¹ÊÔÓÉÏ¢Õù¾öÒªÁì¡£
Ò»¡¢ÎÊÌâÐÎò
ÔÚ×°ÖúÍÉèÖÃGitʱ£¬ÓÐʱ»á·ºÆð¡°Error occurred during initialization of VM£¬java/lang/NoClassDefFoundError: java/lang/Object¡±»ò¡°Error occurred during initialization of VM£¬java/lang/ClassNotFoundException: java/lang/Object¡±µÈÌáÐÑ£¬ÕâÌåÏÖJava¼ÓÔØʧ°Ü¡£
¶þ¡¢ÎÊÌâÔµ¹ÊÔÓÉ
Õâ¸öÎÊÌâµÄÔµ¹ÊÔÓÉÊÇJava SDK£¨Software Development Kit£©µÄ·¾¶±»¹ýʧµØÉèÖÃÔÚÁËGitµÄ·¾¶ÖС£µ±GitÆô¶¯Ê±£¬ËüʹÓÃÁËJavaµÄÖ¸ÁîÀ´½¨ÉèÒ»¸öJavaÐéÄâ»ú£¨JVM£©¡£ÈôÊÇûÓÐ׼ȷµÄJavaÉèÖ÷¾¶£¬¾Í»áµ¼ÖÂJavaÎÞ·¨¼ÓÔØ¡£
Á¬Ã¦Ñ§Ï°¡°JavaÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
Èý¡¢½â¾öÒªÁì
1.¼ì²éJava·¾¶
Ê×ÏÈ£¬ÄúÐèҪȷ±£Java×°Ö÷¾¶µÄ׼ȷÐÔ¡£ÔÚWindowsϵͳÖУ¬Äú¿ÉÒÔͨ¹ýÒÔϲÙ×÷À´¼ì²é£º
1£©·¿ª¡°¿ØÖÆÃæ°å¡±£¬µã»÷¡°³ÌÐò¡±£¬ÔÙµã»÷¡°Java¡±¡£
2£©ÔÚ¡°Java¿ØÖÆÃæ°å¡±ÖУ¬µã»÷¡°Java¡±Ñ¡Ï£¬Éó²éJavaÔËÐÐʱÇéÐεÄ·¾¶¡£
ÈôÊÇJava·¾¶²»×¼È·£¬ÄúÐèÒªÔÚϵͳÇéÐαäÁ¿ÖÐÐÞ¸ÄJavaµÄ×°Ö÷¾¶¡£
2.ÐÞ¸ÄGitÉèÖÃÎļþ
ÈôÊÇJava·¾¶ÒѾ׼ȷÉèÖã¬ÄÇôÄúÐèÒªÐÞ¸ÄGitÉèÖÃÎļþ£¬Ö¸¶¨×¼È·µÄJava·¾¶¡£ÒÔÏÂÊÇÔÚWindowsϵͳÖÐÐÞ¸´ÉèÖÃÎļþµÄÒªÁ죺
1£©½øÈëGit×°ÖÃĿ¼ÏµÄbinÎļþ¼Ð¡£
2£©ÔÚbinÎļþ¼ÐÏ£¬ÓÒ¼üµ¥»÷git.exe£¬²¢Ñ¡Ôñ¡°ÊôÐÔ¡±¡£
3£©ÔÚÊôÐÔ¶Ô»°¿òÖУ¬µã»÷¡°¼æÈÝÐÔ¡±Ñ¡Ï£¬ÏÂÀ²¢Ñ¡ÖС°ÒÔÖÎÀíÔ±Éí·ÝÔËÐд˳ÌÐò¡±¡£
4£©·¿ªbinÎļþ¼ÐϵÄgit-coreĿ¼£¬²¢ÕÒµ½ÃûΪ¡°git-exec¡±µÄÎļþ¡£
5£©ÓÒ¼üµ¥»÷¡°git-exec¡±Îļþ£¬²¢µã»÷¡°±à¼¡±¡£
6£©ÕÒµ½ÒÔÏ´úÂëÐУº
my ($jbase) = $ENV{JAVA_HOME} =~ /^(.*)$/;
7£©½«ÆäÌ滻ΪÒÔÏ´úÂëÐУº
my ($jbase) = “C:/Program Files/Java/jre1.8.0_261” =~ /^(.*)$/;
×¢£º½«¡°C:/Program Files/Java/jre1.8.0_261¡±Ì滻ΪÄúµÄJava×°Ö÷¾¶¡£
8£©ÉúÑIJ¢¹Ø±Õ¡°git-exec¡±Îļþ£¬ÖØÆôGit¡£
ÒÔÉÏÒªÁìÊÊÓÃÓÚWindowsϵͳÖеÄGitÉèÖÃÎļþ£¬ÆäËû²Ù×÷ϵͳµÄGitÉèÖÃÎļþ¿ÉÄÜÓë´Ë²î±ð¡£
ËÄ¡¢×ܽá
ÈôÊÇÄúÔڴGitʱÓöµ½ÁËJava¼ÓÔØʧ°ÜµÄÎÊÌ⣬ÄÇôÐèÒª¼ì²éJava·¾¶ºÍGitÉèÖÃÎļþ¡£È·±£×¼È·ÉèÖúó£¬Äú¾Í¿ÉÒÔÓä¿ìµØʹÓÃGit£¬²¢ÏíÊÜÆä´øÀ´µÄ±ãµ±¡£
ÒÔÉϾÍÊǴgitÌáÐÑjava¼ÓÔØʧ°ÜÔõô°ìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡