java环境变量路径_设置Java环境和类路径

java环境变量路径

An Environment variable is a dynamic "object" on a computer that stores a value(like a key-value pair), which can be referenced by one or more software programs in Windows. Like for Java, we will set an environment variable with name "java" and its value will be the path of the /bin directory present in Java directory. So whenever a program will require Java environment, it will look for the java environment variable which will give it the path to the execution directory.

环境变量是计算机上存储值(如键值对)的动态“对象”,可以由Windows中的一个或多个软件程序引用。 与Java一样,我们将设置一个名为“ java ”的环境变量,其值将是Java目录中/ bin目录的路径。 因此,每当程序需要Java环境时,它将寻找java环境变量,该变量将为它提供执行目录的路径。

设置Windows的路径(2000 / XP / vista / Window 7,8) (Setting up path for windows ( 2000/XP/vista/Window 7,8 ))

Assuming that you have installed Java in C:\ Program files/ Java / JDK directory

假设您已将Java安装在C:\ Program files / Java / JDK目录中

Step 1: Right click on my computer and select properties.

第1步 :右键单击我的计算机,然后选择属性。

setting classpath in java

Step 2: Go to the Advance System Settings tab.

第2步 :转到高级系统设置选项卡。

setting classpath in java

Step 3: Click on Environment Variables button.

步骤3 :点击“环境变量”按钮。

setting classpath in java

Step 4: Now alter the path variable so that it also contains the path to JDK installed directory.

步骤4 :现在更改path变量,使其也包含JDK安装目录的路径。

setting classpath in java

For e.g:- Change C:\windows/ system 32. to C:\windows/system 32; C:\program files / Java/ JDK.

例如:-将C:\ windows / system 32更改为C:\ windows / system 32; C:\ program files / Java / JDK

设置窗口95/98 / ME的路径 (Setting up path for window 95/98/ME)

Assuming that you have installed Java in C:\program files\ java\ JDK directory, do the following:

假设您已将Java安装在C:\ program files \ java \ JDK目录中,请执行以下操作:

Step 1: Edit the C:\autoexec.bat file and add the following line at the end.

步骤1 :编辑C:\ autoexec.bat文件,并在末尾添加以下行。

SET PATH =% PATH% C:\ PROGRAM FILE/JAVA/JDK/bin 

设置Linux,Unix,Solaris和免费BSD的路径 (Setting up path for Linux , Unix , Solaris, free BSD)

Step 1: Environment variable path should be set to point where java binaries have been installed. Refer to your shell if you have trouble doing this.

步骤1 :环境变量路径应设置为指向已安装Java二进制文件的位置。 如果您在执行此操作时遇到困难,请参考您的外壳。

For Example: If you use bash as your shell, then you would add following line to the end

例如:如果您使用bash作为外壳,则可以在末尾添加以下行

bash mc: export PATH=/ Path/to/java 

We recommend you to download latest Java 11 version. Java 11 is a LTS(Long Term Support) version and currently widely in used. You can refer our step by step installation guide to install the Java 11.

我们建议您下载最新的Java 11版本。 Java 11是LTS(长期支持)版本,目前已广泛使用。 您可以参考我们的逐步安装指南来安装Java 11。

Recommended Java Version: Download the latest version of JDK

推荐的Java版本: 下载最新版本的JDK

翻译自: https://www.studytonight.com/java/setting-classpath-for-java.php

java环境变量路径

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值