Windows builds, refreshenv: command not found

I am in need to refresh PATH or JAVA_HOME after installing a JDK using choco install openjdk11 -y.

If I set evn: JAVA_HOME="...." manually it works just fine but I have to hardcode the path to the specific version of the JDK, which is not ideal.

refreshenv command seems to be the ideal solution and everywhere it is said to just call it and you are done, but when calling it inside a Travis Windows build I get: refreshenv: command not found.

I then decided to copy-paste the refreshenv code into a file in the project and call it from there. It gets actually called correctly, but it does not refresh the environment.

Any advice?

See my similar answer to another question about using RefreshEnv.cmd: Install location for iisexpress

1 Like

In the end I solved using Gravis, but thank you for the answer :slight_smile: