set windows PATH environment variable at runtime in Java

后端 未结 4 1708
广开言路
广开言路 2020-12-11 05:58

I have a java program that fires off an executable using the Runtime.exec() method. I\'m using the variant that takes in a set of command line params as one argument, and so

4条回答
  •  离开以前
    2020-12-11 06:22

    If you want to change the Path variable on windows, you should take a look at JNI_Registry: http://www.trustice.com/java/jnireg/

    It's a Java binding to the Windows Registry API and comes with a very small footprint. I have used it for my current project and it works just fine.

提交回复
热议问题