【问题标题】:Eclipse not respond when try to configure GIT尝试配置 GIT 时 Eclipse 没有响应
【发布时间】:2017-11-29 21:22:57
【问题描述】:

Windows 10 专业版 64 位
SSD 金士顿
i5-4690
Eclipse 版本:全部
工作区:空
问题:每次我尝试配置 TEAM > GIT > 配置或尝试导入/创建本地/远程 git 时,eclipse 都会冻结,直到我用任务强制关闭它。
我已经尝试过全新安装 (juno/mars/neon/oxygen) 32/64 位,有无安装程序,但效果不佳

!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.

我的解决方案: “从 USER_FOLDER ( .p2 .eclipse ) 和 PROGRAMFILES 中删除所有文件夹。记得重启!!!!现在一切都可以在 eclipse 氧气和 git 项目中正常工作”

【问题讨论】:

  • 嗨。你设法让它工作吗?在 Win Pro 64 位上升级到 Windows Creators Update 后,我遇到了完全相同的问题。
  • 从 USER_FOLDER (.p2 .eclipse) 和 PROGRAMFILES 中删除所有文件夹。记得重启!!!现在一切都适用于 eclipse 氧气和 git 项目

标签: eclipse git egit


【解决方案1】:

Eclipse 的 GIT 插件会尝试检测是使用操作系统的 GIT 可执行文件,还是使用内置的 GIT。因此它使用bash 命令。

在 Windows 创意者更新之前,bash 命令不存在(除非您安装了 CygWin 或类似程序)。在 Windows 创意者更新中,添加了一个新功能 Windows Subsystem for Linux。首次调用bash 命令时,会询问是否安装此功能。

因此,为了在 Eclipse 中修复 GIT,您只需手动运行一次 bash 并安装它。您可能需要在 Windows 中激活开发人员模式。

【讨论】:

  • 您的解决方案对我有用。这几天我一直在努力解决这个问题。只是为了知识,您是如何找到这个解决方案的?
  • 已经有一段时间了,但如果我没记错的话,我是通过查看 eGit(Eclipse Git 插件)的源代码弄明白的。
  • 非常感谢。我正在拼命寻找解决方案。
  • 这是糟糕的设计。 windows版本至少应该使用批处理命令。知道在哪里可以举报吗?
【解决方案2】:

我遇到了完全相同的问题:Eclipse 在尝试配置 git 时没有响应。

我使用 Java VisualVM 发现 Eclipse 没有响应,因为 Eclipse JGit 正在搜索 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)

我在 Windows 上,安装了适用于 Windows 的 Git,但由于奇怪的原因,未定义指向 Git 的环境变量。

我必须在名为Path的系统变量中添加git.exe的目录(C:\Program Files\Git\bin)

Eclipse 不再冻结。

【讨论】:

    【解决方案3】:

    使用 Eclipse Oxygen 将 git 添加到 Windows 10 上的路径变量对我有用!泰:D

    【讨论】:

    • 嗨蒂芙尼,欢迎来到 SO。随意扩展您的回答,了解用户提出的问题如何从您建议的方法中获得积极的结果,这样您的回答看起来就很完整了。
    【解决方案4】:

    Eclipse 可能正在搜索 bash 可执行文件。

    如果您安装了 Cygwin,请将 Cygwin bin 目录(例如 C:\cygwin64\bin)添加到您的 Path 环境变量中。然后重启eclipse。

    Cygwin bin 目录包含 bash.exe。

    【讨论】:

      【解决方案5】:
      1. 检查你是否已经安装了 Git。
      2. 查看 git 变量是否在环境中正确设置。
      3. 尝试在命令提示符下执行git 命令,它应该首先工作。

      一旦以上步骤都OK,尝试以干净模式重新启动eclipse。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-11-15
        • 1970-01-01
        • 2022-09-27
        • 2013-04-20
        • 1970-01-01
        • 1970-01-01
        • 2021-09-28
        相关资源
        最近更新 更多