31

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.

Laurent.B
  • 213
  • 2
  • 14
Kaloyan Roussev
  • 14,515
  • 21
  • 98
  • 180

6 Answers6

29

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: "Version Control (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... :)
bad_coder
  • 11,289
  • 20
  • 44
  • 72
M. Suscripto
  • 423
  • 4
  • 8
20

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.
approxiblue
  • 6,982
  • 16
  • 51
  • 59
Dinesh Prajapati
  • 9,274
  • 5
  • 30
  • 47
  • Set home to C:\Progra~1\Java\jre7, then restarted computer, restarted Eclipse, cleaned project. Didnt work. Changed to C:\Program Files\Java\jre7, restarted, started, cleaned. Error doesnt go away. Isnt it something to do with the Git? – Kaloyan Roussev Oct 04 '13 at 07:21
  • 1
    in the path take include the bin folder also. – Dinesh Prajapati Oct 04 '13 at 07:57
  • which of the two ways of typing "Program files" should I use? And should I add the whole path in the PATH variable like I did for JAVA variable? Should I restart computer after changes so they are applied? – Kaloyan Roussev Oct 04 '13 at 08:12
  • C:\Program Files\Java\jdk1.7.0_40\bin this one is the correct one for my system. you can modify like this – Dinesh Prajapati Oct 04 '13 at 08:14
  • error still doesnt go away. should I set this in both JAVA_HOME and PATH or only in path?? Should I only set it in SYSTEM or in USER as well? Should I restart the computer for the changes to take effect? – Kaloyan Roussev Oct 04 '13 at 08:39
  • 1
    JAVA_HOME is enough. and if u set for user only that is also fine and restart is needed. for changes to take effect – Dinesh Prajapati Oct 04 '13 at 08:42
  • well I did that but project still has that red exclamation mark and the error log hasnt generated any new errors, so what do I do – Kaloyan Roussev Oct 04 '13 at 14:47
  • 1
    The projects red marks are mainly due to compilation problem, it has nothing to do with java home variable. so your warning error is fixed. for red exclamation is due to library is missing in build path – Dinesh Prajapati Oct 05 '13 at 06:44
  • Wait, New for User variable or new for system variable – Maulzey Sep 29 '15 at 15:42
7

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

Community
  • 1
  • 1
Laurent.B
  • 213
  • 2
  • 14
  • This is baffling to me... I do not have `%HOME%` explicitly set, yet I can `echo %HOME%` and get the correct value. Eclipse does not warn me that %HOME% isn't set... yet egit looks in %HOMEDRIVE%\%HOMEPATH%` for my `.gitconfig`. If I `set HOME=%USERPROFILE%` it all works! why does it matter if HOME is explicitly set? it resolves to the proper place either way. – thekbb Aug 08 '14 at 21:08
  • nope. I got it all to go by adding the `HOME` variable explicitly... but I don't understand why i had to – thekbb Aug 09 '14 at 00:44
  • Sorry I have no explanation for what you describe. – Laurent.B Aug 09 '14 at 01:15
3

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.

-1

This is because JEE package is lacking the Platform SDK. (there is "Eclipse Platform Plug-in Developer Resources" in Eclipse IDE for Eclipse Committers(former Eclipse Standard), but not in Eclipse IDE for Java EE Developers.) You can solve this bug by installing it manually from "The Eclipse Project Updates" site. (Help->Install New Software->choose "The Eclipse Project Updates"->uncheck "Group items by category"->select "Eclipse Platform Plug-in Developer Resources")

(for EGit warnings, they are just warnings and have no relation to this problem)

user2724604
  • 89
  • 1
  • 3
-1

There is no need to set an environment variable HOME or JAVA_HOME for the system or for any user. The required data can easily be given to eclipse or Git or EGit in a small script: - Use your brain to make out where the HOME for ecilpse or Git or EGit should be. You can choose any directory accessible for these programs. For example the directory is N:\somewhere\eclipse\HOME. - Examine the location of the executable eclipse file. - Open a new text file with the Editor or with your favourite text editor app on your desktop or in any directory you like. - Write the following text of 3 lines

SET HOME=N:\somewhere\eclipse\HOME
start "Run Eclipse" "F:\ProgramFiles\eclipse\java-2019-03\eclipse\eclipse.exe"
EXIT
  • Here N:\somewhere\eclipse\HOME is just an exmaple for any existing directory you choose. "Run Eclipse" is an example for the title of the script window. "F:\ProgramFiles\eclipse\java-2019-03\eclipse\eclipse.exe" is an example for the exclipe app to start.
  • save the text file as "RunEclipse.cmd"
  • By executing RunEclipse.cmd you set the HOME environment variable only for this script. eclipse.exe can get it from the script environment and the Error does not occur anymore.
Bussller
  • 1,961
  • 6
  • 36
  • 50