Eclipse not respond when try to configure GIT

匿名 (未验证) 提交于 2019-12-03 08:48:34

问题:

Windows 10 Pro 64 Bit
SSD Kingston
i5-4690
Eclipse version: ALL
Workspace: empty
Problem: everytime i try to configure TEAM > GIT > configuration or i try to import/create local/remote git, eclipse freeze until i force to close it with task.
I have already tryed a fresh install ( juno/mars/neon/oxygen ) 32/64 bit with and without installer with no good results

!SESSION 2017-06-27 00:39:29.113 ----------------------------------------------- eclipse.buildId=4.7.0.I20170531-2000 java.version=1.8.0_91 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT Framework arguments:  -product org.eclipse.epp.package.java.product Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product  !ENTRY org.eclipse.egit.ui 2 0 2017-06-27 00:39:50.111 !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git user global configuration and to define the default location to store repositories: 'C:\Users\Enrico'. If this is not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and EGit might behave differently since they see different configuration options. This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. !SESSION 2017-06-27 00:41:04.510 ----------------------------------------------- eclipse.buildId=4.7.0.I20170531-2000 java.version=1.8.0_91 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT Framework arguments:  -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data file:/C:/Users/Enrico/workspace/ -product org.eclipse.epp.package.java.product  !ENTRY org.eclipse.egit.ui 2 0 2017-06-27 00:41:13.439 !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git user global configuration and to define the default location to store repositories: 'C:\Users\Enrico'. If this is not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and EGit might behave differently since they see different configuration options. This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. !SESSION 2017-06-27 00:42:32.097 ----------------------------------------------- eclipse.buildId=4.7.0.I20170531-2000 java.version=1.8.0_91 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT Framework arguments:  -product org.eclipse.epp.package.java.product Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product  !ENTRY org.eclipse.egit.ui 2 0 2017-06-27 00:42:42.119 !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git user global configuration and to define the default location to store repositories: 'C:\Users\Enrico'. If this is not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and EGit might behave differently since they see different configuration options. This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. !SESSION 2017-06-27 00:45:05.785 ----------------------------------------------- eclipse.buildId=4.7.0.I20170531-2000 java.version=1.8.0_91 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT Framework arguments:  -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data file:/C:/Users/Enrico/workspace/ -product org.eclipse.epp.package.java.product  !ENTRY org.eclipse.egit.ui 2 0 2017-06-27 00:45:13.542 !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git user global configuration and to define the default location to store repositories: 'C:\Users\Enrico'. If this is not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and EGit might behave differently since they see different configuration options. This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. !SESSION 2017-06-27 00:47:39.707 ----------------------------------------------- eclipse.buildId=4.7.0.I20170531-2000 java.version=1.8.0_91 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=it_IT Framework arguments:  -product org.eclipse.epp.package.java.product Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product  !ENTRY org.eclipse.egit.ui 2 0 2017-06-27 00:47:49.374 !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git user global configuration and to define the default location to store repositories: 'C:\Users\Enrico'. If this is not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and EGit might behave differently since they see different configuration options. This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 

MY SOLUTION: "Delete all folders from USER_FOLDER ( .p2 .eclipse ) and PROGRAMFILES. Remember to reboot!!!! Now all works fine with eclipse oxygen and git project"

回答1:

The GIT plugin of Eclipse tries to detect whether to use the GIT executable of the OS, or the build-in GIT. Therefor it uses a bash command.

Before the Windows Creators Update, the bash command did not exist (unless you've installed CygWin or a similar program). With the Windows Creators Update, a new feature Windows Subsystem for Linux is added. When the bash command is first called, it asks whether to install this feature or not.

So in order to fix GIT in Eclipse, you just have to manually run bash once and install it. You may have to activate Developer Mode in Windows.



回答2:

I had the exact same issue: Eclipse was not responding when trying to configure git.

I used Java VisualVM and discovered that Eclipse was not responding because of Eclipse JGit was searching for git.

 at java.io.FileInputStream.readBytes(Native Method)     at java.io.FileInputStream.read(Unknown Source)     at java.io.BufferedInputStream.read1(Unknown Source)     at java.io.BufferedInputStream.read(Unknown Source)     - locked <0x00000000cf57bf60> (a java.io.BufferedInputStream)     at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)     at sun.nio.cs.StreamDecoder.implRead(Unknown Source)     at sun.nio.cs.StreamDecoder.read(Unknown Source)     - locked <0x00000000cf382838> (a java.io.InputStreamReader)     at java.io.InputStreamReader.read(Unknown Source)     at java.io.BufferedReader.fill(Unknown Source)     at java.io.BufferedReader.readLine(Unknown Source)     - locked <0x00000000cf382838> (a java.io.InputStreamReader)     at java.io.BufferedReader.readLine(Unknown Source)     at org.eclipse.jgit.util.FS.readPipe(FS.java:528)     at org.eclipse.jgit.util.FS.readPipe(FS.java:479)     at org.eclipse.jgit.util.FS_Win32.discoverGitExe(FS_Win32.java:127)     at org.eclipse.jgit.util.FS.discoverGitSystemConfig(FS.java:647) 

I am on Windows, Git for Windows was installed, but for a strange reason the Environment Variable pointing on Git was not defined.

I had to add the directory of git.exe (C:\Program Files\Git\bin) in the System variable named Path.

Eclipse is not freezing anymore.



回答3:

if you have cygwin,add cygwin bin dir to path. Cygwin have a bash.exe



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!