admin管理员组文章数量:1393284
Windows 10, Java 17. I have set a run configuration on Intellij to JAR Application. Once i add, remove or modify an environment variable, the app does not reckognize it.
I have tried:
- Restarting Intellij
- Echoing the environment variable values on cmd
Thhe only thing that seems to work is a PC restart.
Windows 10, Java 17. I have set a run configuration on Intellij to JAR Application. Once i add, remove or modify an environment variable, the app does not reckognize it.
I have tried:
- Restarting Intellij
- Echoing the environment variable values on cmd
Thhe only thing that seems to work is a PC restart.
Share Improve this question edited Mar 15 at 15:26 Robert 43k18 gold badges109 silver badges172 bronze badges asked Mar 14 at 17:21 TSSKTSSK 2291 gold badge6 silver badges19 bronze badges 1- @Robert Windows 10, with UI. – TSSK Commented Mar 15 at 14:57
1 Answer
Reset to default 1Each process on Windows holds it's own copy of all environment variables. It gets them on start by copying the environment variables of the parent process (the one that has started the process, e.g. Windows Explorer for programs started via start-menu or shortcut on desktop).
If you use the Windows dialog to modify the environment variables this will not change anything to the running processes. When you save the modified environment variables Windows sends a message to all running processes that the environment variables have changed. Those processes that listen for this message will then request the changes and update their environment variables accordingly.
Besides the processes that belong to Windows most processes just ignore this message. This becomes important if you use third party launcher like Open-Shell menu which do not update their environment variables. If you use it to start e.g. a new IntelliJ instance the old environment variables will be used.
Conclusion: The main question is how you start IntelliJ. After changing environment variables make sure to only start it using programs that have updated their environment variables. Or make sure to restart those programs as well.
本文标签:
版权声明:本文标题:java - Quarkus app running in Intellij with a JAR Application run configuration is not reading environment variables unless i re 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744639814a2617052.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论