Eclipse项目范围错误:警告:未设置环境变量HOME.以下目录将用于存储Git

J. *_* K. 21 eclipse git egit

启动Eclipse并得到此错误.我如何解决它?

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:\Documents and Settings\Wizard'. 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.
Run Code Online (Sandbox Code Playgroud)

如果需要任何其他信息,请告诉我,我会提供.

小智 23

其他答案没有考虑如果你不使用Git,那么你可以完全忽略这个警告,以及"EGit无法检测"的警告.

但我知道......强迫性思维不能忽视......他们无论如何都需要修复它,对吗?

然后继续:

  1. 转到"窗口 - >首选项"菜单
  2. 展开:"团队 - > Git - >确认和警告"
  3. 取消选中"主目录"和"Git前缀"框
  4. 在Workspace日志中,删除旧警告(红叉图标)
  5. 重启Eclipse
  6. 通过你的心灵感受到和平...... :)

  • 这个答案给我的生活带来了多少和平,这是不自然的。 (3认同)

Din*_*ati 16

您需要在系统中设置JAVA_HOME变量.取决于您的操作系统,您可以检查"如何设置环境变量?" 从那时起,您需要设置环境变量

变量名称:JAVA_HOME值:Java upto bin文件夹的路径

  1. 在Windows 7中,在开始菜单中键入"environment"
  2. 选择"为您的帐户编辑环境变量"
  3. 单击"新建"按钮.
  4. 在名称字段中输入"HOME"
  5. 在值字段中输入"%USERPROFILE%"或其他路径.
  6. 单击确定,然后再次单击确定.您刚刚在Windows上添加了主目录.


Lau*_*t.B 7

这是一个警告,因为未定义HOME环境,而EGit(Git插件)需要它知道Git配置和存储库的位置.默认情况下,它将使用当前用户基目录,但风险在于,如果您在其他位置安装了Git,则EGit和Git可能具有不同的行为.如果您不使用Git,请按照说明停用警告.

以下是EGit用户指南:https://wiki.eclipse.org/EGit/User_Guide#Setting_up_the_Home_Directory_on_Windows 它解释了您必须将%USERPROFILE%设置为HOME变量作为值.

您也可以在Windows上检查http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup更改.gitconfig位置