如何在Windows中的Java中设置路径?

To set path in java in two ways:

要通过两种方式在Java中设置路径:

  1. Temporary [Work Till PC Shutdown]

    临时[工作至电脑关闭]

  2. Permanent [Work for always]

    永久[永远工作]

1)设置临时路径 (1) Setting temporary path)

First, we will study how to set a temporary path for compiling and execution of java program?

首先,我们将研究如何为Java程序的编译和执行设置临时路径?

  1. Open the command prompt

    打开命令提示符

  2. We will copy the address of the JDK/Bin directory and let us suppose our JDK Address is "C:\Program Files\Java\jdk-10.0.2\bin" then copy this address.

    我们将复制JDK / Bin目录的地址,并假设我们的JDK地址为“ C:\ Program Files \ Java \ jdk-10.0.2 \ bin”,然后复制该地址。

  3. After copying address come back to command prompt screen and type a command like this,

    复制地址后,返回命令提示符屏幕,然后输入如下命令:

  4. path = C:\Program Files\Java\jdk-10.0.2\bin and press enter.

    路径= C:\ Program Files \ Java \ jdk-10.0.2 \ bin ,然后按Enter键。

2)设置永久路径 (2) Setting permanent path)

Second, we will study how to set a temporary path for compiling and execution of java program.

其次,我们将研究如何为Java程序的编译和执行设置临时路径。

1) Go to the My Computer icon and right-click on the icon and go to the properties option and click on it. Please see the below screenshot.

1)转到我的电脑图标,然后右键单击该图标,然后转到属性选项,然后单击它。 请看下面的截图。

set path in java (1)

2) After clicking on properties option a new window will appear on the screen like this.

2)单击属性选项后,这样的屏幕上将出现一个新窗口。

set path in java (2)

3) After clicking on properties option then go to the advanced system settings tab and then click on it then a new window will appear on the screen[System Properties].

3)在单击属性选项后,转到高级系统设置选项卡,然后单击它,然后在[系统属性]屏幕上将出现一个新窗口。

set path in java (3)

4) After clicking on advanced system settings tab a new window will appear on the screen [System Properties] and then go to the Environment Variables and then click on it.

4)单击高级系统设置选项卡后,新窗口将出现在[系统属性]屏幕上,然后转到环境变量,然后单击它。

set path in java (4)

5) After clicking on Environment Variables button then a new window will appear on the screen [Environment Variables] then go to the path of user variable and click on edit option and in case if path option does not exists then we can create new variable by clicking on new button of user variable.

5)单击环境变量按钮后,[环境变量]屏幕上将出现一个新窗口,然后转到用户变量的路径并单击编辑选项,如果路径选项不存在,则可以通过以下方式创建新变量:单击用户变量的新按钮。

set path in java (5)

6) After clicking on the edit button of user variables then a new window will appear on the screen [Edit Environment variable] then go to the new button and click on it and there paste the path of JDK and click on ok button.

6)单击用户变量的编辑按钮后,[Edit Environment variable]屏幕上将出现一个新窗口,然后转到新按钮并单击它,然后粘贴JDK的路径并单击ok按钮。

set path in java (6)

翻译自: https://www.includehelp.com/java/how-to-set-path-in-java-in-windows.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值