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](https://i-blog.csdnimg.cn/blog_migrate/5cc2bb182ca83ed336001b681d876541.png)
Step 2: Go to the Advance System Settings tab.
第2步 :转到高级系统设置选项卡。
![setting classpath in java](https://i-blog.csdnimg.cn/blog_migrate/90f5467363d05d1c6e86d825a5cbbdac.png)
Step 3: Click on Environment Variables button.
步骤3 :点击“环境变量”按钮。
![setting classpath in java](https://i-blog.csdnimg.cn/blog_migrate/250ad6d73e4be18e6e3e617035980d08.png)
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](https://i-blog.csdnimg.cn/blog_migrate/6f2fe094b4ae82fd09b05296b7aba2ba.png)
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环境变量路径