如何设置 PATH 以同时使用 Java 和 Python
我只是想知道是否有任何方法可以设置 %PATH%
变量,以便我可以编译我的 Java 代码以及我的 Python 代码?
例如.. PATH 当前是C:\ ... JDK_bin blah blah
,就是这样。要运行我的 python 代码,我必须完全更改我的路径变量。
有答案吗?
I was just wondering if there was any way to set to %PATH%
variables so I can compile my Java code, along with my Python code?
For instance.. PATH is currently C:\ ... JDK_bin blah blah
, and that's it. To run my python code, I have to change my path variable completely.
Any answers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要将 python exe 的路径添加到现有的 PATH 变量中,该变量中已经包含 Java exe 的路径以及更多路径。
您还可以使用 Windows GUI 执行此操作。
请注意,对
PATH
进行绝对分配会覆盖它,从而丢失它已有的路径。
You need to add the path to python exe to your existing
PATH
variable which already has path to Java exes and many more paths in it.You can also do this using windows GUI.
Note that doing an absolute assignment to
PATH
likewill overwrite it, loosing the path(s) it already had.
PATH 变量中可以有多个路径。用 ; 分隔路径在 Windows 上和 : 在 *nix 上。
PATH variables can have multiple paths in them. Separate paths with ; on Windows and : on *nix.
只需在当前路径后添加一个分号,然后在其后写入新的分号即可。
ETC...
Just add a semicolon after your present path, and write the new one after that.
etc...