Java 如何将 PATH 环境变量设置为指向 JRE 1.5 版
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3518172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I set the PATH environment variable to point to JRE version 1.5
提问by JavaNoob
Hi there I have a program that requires me to set the PATH environment variable to point to JRE version 1.5 as I need to access the program via a command prompt. So any ideas on how to do that?
您好,我有一个程序需要我将 PATH 环境变量设置为指向 JRE 1.5 版,因为我需要通过命令提示符访问该程序。那么关于如何做到这一点的任何想法?
采纳答案by Borealid
Go to the control panel > System > Advanced and edit your environment variables there. Append "; C:\path\to\the\jre\bin" to the PATH variable. Open a new terminal and profit.
转到控制面板 > 系统 > 高级并在那里编辑您的环境变量。将 "; C:\path\to\the\jre\bin" 附加到 PATH 变量。打开一个新的终端并获利。
回答by w00d
In linux from your console:
在你的控制台的 linux 中:
export PATH=$PATH:your_jre_path_here
In Window:
在窗口中:
- From the desktop, right-click My Computer and click Properties.
- In the System Properties window, click on the Advanced tab.
- In the Advanced section, click the Environment Variables button.
- In the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button.Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon e.g:C:\Program Files;C:\Winnt;C:\Winnt\System32
- 在桌面上,右键单击我的电脑,然后单击属性。
- 在“系统属性”窗口中,单击“高级”选项卡。
- 在高级部分中,单击环境变量按钮。
- 在“环境变量”窗口中,突出显示“系统变量”部分中的“路径”变量,然后单击“编辑”按钮。使用您希望计算机访问的路径添加或修改路径行。每个不同的目录用分号分隔,例如:C:\Program Files;C:\Winnt;C:\Winnt\System32
回答by Joe Kasedde
Set JAVA_HOME:
设置 JAVA_HOME:
Right click My Computer and select Properties.
右键单击我的电脑并选择属性。
On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.7.0_79
在Advanced选项卡,选择Environment Variables,然后编辑JAVA_HOME指向JDK软件所在的位置,例如C:\Program Files\Java\jdk1.7.0_79
Be sure to download a compatible version of Java JDK for either 64 bit or 32 bit from http://java.sun.com/javase/downloads/index.jsp.
请务必从http://java.sun.com/javase/downloads/index.jsp下载 64 位或 32 位的兼容版本的 Java JDK 。