Java development environment configuration, some problems encountered

First, the difference between jdk and jre

1. jdk is a java development environment for java developers, jre is a java running environment for java program users, jdk contains jre
2. If the JDK is installed, two sets of JRE will be sent to your computer, one set is located in \ jre another set located in C: \ Program Files \ under Java \ j2re1.4.1_01 directory, Server back end of this less than the previous set of the Java virtual machine, but directly before the
transfer surface of the set of Server-side Java virtual machine to come on the line Too. And you can choose whether to install
the JRE located in the C: \ Program Files \ Jav a directory when installing the JDK . If you only install the JRE, not the JDK, then only the only set of JRE will be installed in the C: \ Program Files \ Java directory.

2. After the jdk environment is configured, it is found that java can be executed directly on the command line, but javac cannot

情况1: 不是内部或外部命令,不是可执行文件或批处理文件
    原因: 配置的环境变量不对, 环境变量配置如下:
        1、在系统变量中, 新建变量 JAVA_HOME, 值为 jdk 的安装路径, 比如: C:\Program Files\Java\jdk1.8.0_66
        2、PATH: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
        3、新建变量, CLASSPATH: 值为: .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;
Published 190 original articles · 19 praises · 200,000+ views

Guess you like

Origin blog.csdn.net/zengchenacmer/article/details/52236028