如何设置 PATH 以同时使用 Java 和 Python

发布于 2024-09-29 05:47:45 字数 190 浏览 0 评论 0原文

我只是想知道是否有任何方法可以设置 %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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我不咬妳我踢妳 2024-10-06 05:47:52

您需要将 python exe 的路径添加到现有的 PATH 变量中,该变量中已经包含 Java exe 的路径以及更多路径。

path = %PATH%;C:\path\to\python\bin

您还可以使用 Windows GUI 执行此操作。

请注意,对 PATH 进行绝对分配

set PATH = C:\path\to\python\bin

覆盖它,从而丢失它已有的路径。

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.

path = %PATH%;C:\path\to\python\bin

You can also do this using windows GUI.

Note that doing an absolute assignment to PATH like

set PATH = C:\path\to\python\bin

will overwrite it, loosing the path(s) it already had.

以可爱出名 2024-10-06 05:47:52

PATH 变量中可以有多个路径。用 ; 分隔路径在 Windows 上和 : 在 *nix 上。

set PATH=c:\path\to\java;c:\path\to\python

PATH variables can have multiple paths in them. Separate paths with ; on Windows and : on *nix.

set PATH=c:\path\to\java;c:\path\to\python
墨落成白 2024-10-06 05:47:51

只需在当前路径后添加一个分号,然后在其后写入新的分号即可。

set PATH="C:\Program Files\Java\blah\blah";C:\Python31\;C:\Windows\System32

ETC...

Just add a semicolon after your present path, and write the new one after that.

set PATH="C:\Program Files\Java\blah\blah";C:\Python31\;C:\Windows\System32

etc...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文