0

I know that the resulting path is the concatenation of system + user variables. However, my resulting path contains an entry which I don't know where is coming from, and on top of that is malformed, so it's causing some problems.

C:\Users\sarc83518>path
PATH=C:\Program Files (x86)\Razer\ChromaBroadcast\bin;C:\Program Files\Razer\ChromaBroadcast\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Git\cmd;C:\Program Files\PuTTY;C:\Program Files\dotnet;C:\Program Files\apache-maven-3.6.3\bin;C:\Program Files\gradle\gradle-6.8\bin;C:\ProgramData\chocolatey\bin;c:\dev;C:\Program Files\PowerShell\7;C:\Users\L1_asarco\AppData\Local\Microsoft\WindowsApps;C:\Users\sarc83518.jdks\jdk-16.0.1\bin;C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Amazon\AWSCLIV2;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\sarc83518.jdks\jdk-16.0.1=:\Users\sarc83518.jdks\openjdk-8u282-b0;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps

(look at the entry in bold)

These are my system variables:
These are my system variables

And this is my user variable:
enter image description here

As you can see, this wrong entry appears between my system and user variables, and I have no idea where is it coming from. How can I get rid of it?

Edit: here's the value of JAVA_HOME, and Java works fine, that's not the problem. enter image description here I'm not adding anything to the path manually, the entry in bold just appears there and I don't know where is coming from, it causes problems with some application that tries to read the path entries one by one and fails at that one because is not a valid path.

I'm going to delete duplicate entries, but that is not causing this issue.

Edit2: Volatile Environment, looks good. enter image description here

15
  • I would almost guarantee you have extended the length 1920 that is allowed for a system variable. The simplest solution most likely would be to set the value of the PATH variable, within a command prompt, to a different value. You could use the GUI to copy the entire string, set the variable to something short, then set it back to the original text value. I am guessing you have ran something like java -version only for it to fail?
    – Ramhound
    Commented Sep 1, 2021 at 19:02
  • Did you not forget a semicolon when appending to PATH? C:\Users\sarc83518>path vs. C:\Users\sarc83518;>path? Commented Sep 1, 2021 at 19:11
  • 1
    @Ramhound: His PATH is only 1016 characters. And it's Windows that does the appending.
    – harrymc
    Commented Sep 1, 2021 at 19:18
  • C:\Users\sarc83518.jdks\jdk-16.0.1\bin - Appears to be another mistake.
    – Ramhound
    Commented Sep 1, 2021 at 19:33
  • @Alex: (1) Verify in CMD the value of %USERPROFILE%. (2) Use regedit to position to Computer\HKEY_USERS, enter first long sub-key, then sub-key Volatile Environment; what do you have in item USERPROFILE?
    – harrymc
    Commented Sep 1, 2021 at 19:34

1 Answer 1

0

There are multiple problems here.

  1. Your path variables are repeated. Copy all the path variables to a text file.

%SYSTEMROOT% is C:\Windows

Remove the entries from 3-8

  1. Uninstall JAVA on your system. You can reinstall later. Now check the path variables, and if JAVA is still there, delete it manually. As some others have others, the JAVA path variables are messed up.
7
  • 1 - Yes, there were some duplicates that I removed, but that's not going to help (and it didn't) with this problem. 2 - There is nothing to uninstall, because I didn't install Java in the first place, I just copied the the zip file to its current location and added the correct JAVA_HOME manually. Java works fine, that's not the problem.
    – Alex
    Commented Sep 2, 2021 at 8:13
  • @Alex - You had to have installed Java since you had multiple different versions. You installed Java or something you installed required it so it was installed. Java isn’t installed on Windows unless a user installs it.
    – Ramhound
    Commented Sep 2, 2021 at 9:48
  • @Alex - Just so I am a better understanding, your saying if you modify the PATH variable, then echo PATH your changes are not reflected after closing the prompt and reopening?
    – Ramhound
    Commented Sep 2, 2021 at 10:10
  • When I say I haven't installed, I meant I didn't run an exe or msi installer for Java. You can also download a zip file with the binaries and extract that somewhere in you disk and as long as is in the path, it'll work. That's what I did.
    – Alex
    Commented Sep 2, 2021 at 12:05
  • @Ramhound If I modify the path using the interface, changes are reflected after I restart the terminal, but that's not the problem. The problem is that invalid entry with the =: in the middle, which is not in the UI, I didn't add it, and therefore I cannot remove it. I could remove it by manipulating the PATH variable directly in the command line, but then the changes would be lost after a console restart.
    – Alex
    Commented Sep 2, 2021 at 12:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .