Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse project-wide error: Warning: The environment variable HOME is not set. The following directory will be used to store the Git

Tags:

git

eclipse

egit

Started Eclipse and got this error. How do I fix it?

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.

If any additional information is needed, let me know and I will provide it.

like image 690
Kaloyan Roussev Avatar asked Oct 04 '13 06:10

Kaloyan Roussev


4 Answers

The other answers don't contemplate that if you don't use Git, then you can entirely ignore this warning, along with the "EGit could not detect" one.

But I know... obsessive minds can't just ignore... they NEED to fix it anyway, right?

Then proceed:

  1. Go to "Window --> Preferences" menu
  2. Expand: "Team --> Git --> Confirmations and warnings"
  3. Uncheck the "Home directory" and "Git prefix" boxes
  4. Ok
  5. In the Workspace log, delete the old warnings (red cross icon)
  6. Restart Eclipse
  7. Feel the peace spreading through your mind... :)
like image 57
M. Suscripto Avatar answered Oct 23 '22 14:10

M. Suscripto


You need to set the JAVA_HOME variable in your system. Depends on your Operating system you can check for "How to set Environment variable?" and from that point you need to set environment variable

Variable Name : JAVA_HOME Value : Path of Java upto bin folder

  1. In Windows 7, type "environment" at the start menu
  2. Select "Edit environment variables for your account"
  3. Click the "New" button.
  4. Enter "HOME" in the name field
  5. Enter "%USERPROFILE%" or some other path in the value field.
  6. Click OK, and OK again. You have just added the Home directory on Windows.
like image 43
Dinesh Prajapati Avatar answered Oct 23 '22 14:10

Dinesh Prajapati


You should study the official documentation

Setting up the Home Directory on Windows

Add the environment variable HOME to your environment variables.

In Windows 7:

  1. type "environment" at the start menu.
  2. Select "Edit environment variables for your account".
  3. Under "User Variables", click the "New" button.
  4. Enter "HOME" in the name field.
  5. Enter "%USERPROFILE%" or some other path in the value field.
  6. Click OK, and OK again. You have just added the Home directory on Windows.

File > Exit, then restart the application.

like image 40
Jorge Bastida Cano Avatar answered Oct 23 '22 14:10

Jorge Bastida Cano


This is a warning because the HOME environment is not defined, whereas EGit (plugin for Git) need it to know where to locate the Git configuration and repository. By default it will use the current user base directory but the risk is that if you have Git installed at a different location, EGit and Git may have different behaviors. If you don't use Git, just deactivate the warning as explained.

Here is the EGit user guide : https://wiki.eclipse.org/EGit/User_Guide#Setting_up_the_Home_Directory_on_Windows It explains that you have to set the HOME variable with the %USERPROFILE% as value.

You may check that too http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup and Changing .gitconfig location on Windows

like image 21
Laurent.B Avatar answered Oct 23 '22 14:10

Laurent.B