java 如何在Windows路径系统中添加Java bin文件夹路径

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30699600/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 17:32:04  来源:igfitidea点击:

How to add Java bin folder path in Windows path system

java

提问by majnun

i have a problem with running a Java software which is made for Windows. Actually I want run it on kali Linux but whenever I try to run the soft it tells me add Java bin folder path in Windows path system variable.

我在运行为 Windows 开发的 Java 软件时遇到问题。实际上我想在 kali Linux 上运行它,但是每当我尝试运行软件时,它都会告诉我在 Windows 路径系统变量中添加 Java bin 文件夹路径。

and thats my Java version

那是我的 Java 版本

java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) Server VM (build 25.40-b25, mixed mode)

How can I solve this?

我该如何解决这个问题?

回答by RogerUK

Add Variables - Java

添加变量 - Java

First, you need to Locating the Environment Variables

首先,您需要定位环境变量

1.Open up the system properties (WinKey + Pause)and you should see the below screen.

1.打开系统属性(WinKey + Pause),您应该会看到以下屏幕。

enter image description here

在此处输入图片说明

2.From the system properties, tab select the "Advanced"link. This should take you to the below screen.

2.从系统属性中,选择“高级”链接。这应该带你到下面的屏幕。

enter image description here

在此处输入图片说明

3.From the System Properties screen select the "Advanced Tab". On this screen click the "Environment Variables"button.

3.从系统属性屏幕中选择“高级选项卡”。在此屏幕上单击 “环境变量”按钮。

4.You should now be seeing something like the below screen.

4.您现在应该会看到类似以下屏幕的内容。

enter image description here

在此处输入图片说明

Now You Are Ready To Add Variables - JAVA

现在您已准备好添加变量 - JAVA

In the system variablessection click in the "New"button.

系统变量部分单击“新建”按钮。

In here enter the variable name : JAVA_HOME

在这里输入变量名:JAVA_HOME

Enter the variable value as the location of the java jdk installed in the previous section. (This is assuming you already have installed Java SDK. If you haven't now is the time to do it)

输入变量值作为上一节安装的java jdk的位置。(这里假设您已经安装了 Java SDK。如果您还没有安装,现在是时候安装了)

For Example of my location below. (Please note the variable value will vary depending on your install location and version of the jdk)

例如我在下面的位置。(请注意变量值会根据您的安装位置和 jdk 版本而有所不同)

enter image description here

在此处输入图片说明

Click ok to complete this action. Once completed you should see the JAVA_HOMEvariable in the list of system variables.

单击确定完成此操作。完成后,您应该会在系统变量列表中看到JAVA_HOME变量。

Next, you need to add the newly created JAVA_HOMEvariable on to your path.

接下来,您需要将新创建的JAVA_HOME变量添加到您的路径中。

To do this locate the "Path"variable in the system variables list. Select it and click the edit button.

为此,请在系统变量列表中找到“Path”变量。选择它并单击编辑按钮。

This should bring up the below option.

这应该会显示以下选项。

enter image description here

在此处输入图片说明

Scroll to the end of the "variable value"field and append on the following

滚动到“变量值”字段的末尾并附加以下内容

;%JAVA_HOME%\bin

;%JAVA_HOME%\bin

Click "OK"to confirm and leave the edit path screen.

单击“确定”确认并离开编辑路径屏幕。

Once complete click "OK"to confirm and leave the Environment variables screen.

完成后单击“确定”确认并离开环境变量屏幕。

Next, open a newcommand prompt (Winkey + R then type cmd)and run "java -version"to verify that it is correctly installed.

接下来,打开一个新的命令提示符(Winkey + R 然后键入 cmd)并运行“java -version”以验证它是否已正确安装。

If it is you should see something similar to the below screenshot.

如果是,您应该会看到类似于以下屏幕截图的内容。

enter image description here

在此处输入图片说明

回答by VILLAIN bryan

WINDOWS SOLUTION:To make sure that Windows can find the Java compiler and interpreter:

WINDOWS 解决方案:要确保 Windows 可以找到 Java 编译器和解释器:

Select Start -> Computer -> System Properties -> Advanced system settings -> Environment Variables -> System variables -> PATH. ... Prepend C:\Program Files\Java\jdk1.8.0_40\bin; to the beginning of the PATH variable.

选择开始 -> 计算机 -> 系统属性 -> 高级系统设置 -> 环境变量 -> 系统变量 -> PATH。... 前置 C:\Program Files\Java\jdk1.8.0_40\bin; 到 PATH 变量的开头。

OTHER OS SOLUTIONS:https://java.com/en/download/help/path.xml

其他操作系统解决方案:https : //java.com/en/download/help/path.xml