0

After setting the CLASSPATH environmental variable on Windows Server 2016 using the Control Panel/System/Advanced Settings/Environmental Variables UI Tool - the CLASSPATH value reverts back to its original value when the system is restarted.

We looked at other answers and this was the method they described for setting the value permanently (i.e. as opposed to setting it at the command line which isn't.)

Why is this happening? How do we ensure the new value for the environmental variable stays to the value to which we set it?

Praxiteles
  • 101
  • 1
  • 2
  • 1
    Most likely something is changing it back. Could be a group policy setting, for example, or a startup script, or perhaps some third-party software you have installed. – Harry Johnston Dec 20 '19 at 21:45
  • 1
    ... the first experiment you should try is to create a new environment variable and see whether that one sticks. – Harry Johnston Dec 20 '19 at 21:47

1 Answers1

1

The same way you do it in any other windows server version - by setting the environment variable on system level.

Alternatively from the command line look up a tool named setX which does that - but it will NOT change variables in other running processes, which are copied from the system settings at process start.

TomTom
  • 51,649
  • 7
  • 54
  • 136
  • Per our question - is the UI path we listed not the system level change? We thought it was - but the changes didn't stick. That's the part that is confusing us. – Praxiteles Dec 19 '19 at 16:39