2

In Windows 7 I set the PATH environment variable thus:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%M2_HOME%\bin;%ANT_HOME%\bin;R:\bin;P:\bin;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files\SlikSvn\bin\;C:\Program Files\TortoiseSVN\bin

When I log out and log in, and then bring up a command prompt, all my environment variables are properly expanded---except M2_HOME. If I bring up the edit window for the PATH environment variable and simply hit OK with no edits, when I open up a command prompt the M2_HOME variable is properly replaced, and remains so until I log out.

I don't understand this. Even if this were a definition order problem, M2_HOME appears before PATH alphabetically. What's going on?

Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
  • I don't know the answer, but are you talking about the system variable PATH or the user variable PATH ? Is M2_HOME a system variable or a user variable ? System environment variables should not contain references to user environment variables, so that might possibly be the problem. – Enwired Jun 29 '12 at 18:32
  • 1
    These were all system variables. I'm not sure if the problem is still occurring---it could have been some odd thing Microsoft fixed with an update. – Garret Wilson Jun 29 '12 at 19:16

2 Answers2

1

I have Windows 7 and use maven, so I have M2_HOME and M2 environment variables and they work OK. If you want to see what's going on inside you can use the RapidEE environment variable editor. That may help.

I can show you what I have:

  • M2 = %M2_HOME%\bin
  • M2_HOME = b:\repository\maven\v03.00
  • path = ...;%M2%; ...

Seems to work OK. I didn't do much checking on expansions because everything was working.

If I look at path in the shell, is expands to

  • path = ...;b:\repository\maven\v03.00\bin; ...

Good luck, w.

will
  • 4,799
  • 8
  • 54
  • 90
1

While this is not a solution, I hope this will help you track down your issue. I have recently faced various issues with Windows 7 and Path expansion. Try removing the entries you have with spaces, if that does not help, remove everything except the stock entries and M2_HOME. I am just recommending you to remove this to see if it helps you track down your issue. If you determine that an entry with a space is causing this, we can look for another solution (8.3 path?)...

Fred
  • 402
  • 4
  • 9