Java development environment configuration
In this chapter we will introduce how to build a Java development environment.
Window system installation java
Download JDK
First we need to download the java development tool kit JDK, download address: http://www.oracle.com/ technetwork/java/javase/downloads/, click the following download button:
In the download page, you need to choose to accept the license and select the corresponding version according to your system, this article Take the Window 64-bit system as an example:
##After downloading, install the JDK according to the prompts. When installing the JDK, the JRE will also be installed. Just install it together. Install JDK. During the installation process, you can customize the installation directory and other information. For example, we choose the installation directory asC:\Program Files (x86)\Java\jdk1.8.0_91.
Configure environment variables1. After the installation is complete, right-click "My Computer", click "Properties", and select "Advanced System Settings";2. Select the "Advanced" tab and click "Environment Variables"; Then the screen as shown below will appear:
Set 3 properties in "System Variables", JAVA_HOME, PATH, CLASSPATH (case does not matter). If it already exists, click "Edit", if it does not exist, click "New". The variable setting parameters are as follows:
- Variable name:
JAVA_HOME
- Variable value:
C:\Program Files (x86)\Java\jdk1.8.0_91 // Configure according to your actual path
- ##Variable name:
- CLASSPATH
- .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
/ /Remember there is a "." in front
- Variable name:
- Path
- %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
PATH Settings
CLASSPATH Settings
This is for Java Environment configuration. After the configuration is completed, you can start Eclipse to write code, and it will automatically complete the configuration of the java environment.
Note: If you use JDK version 1.5 or above, you can compile and run Java programs normally without setting the CLASSPATH environment variable.
Test whether the JDK is installed successfully
1. "Start"->"Run", type "cmd";
2. Type the command: java -version, java, javac Several commands, the following information appears, indicating that the environment variable configuration is successful;
##Linux, UNIX, Solaris, FreeBSD environment variable settingsThe environment variable PATH should be set to point to the location where the Java binaries are installed. If you have trouble setting up, please refer to the shell documentation. For example, assuming you are using bash as your shell, you can add the following to the end of your .bashrc file: export PATH=/path/to/java:$PATH
popularJAVADevelopmentTools As the saying goes, if you want to do your job well, you must first sharpen your tools. We also need good development tools in the process of developing the Java language. There are many IDEs on the market. This article is for everyone. The following java development tools are recommended:
Eclipse (recommended):Another free and open source java IDE, download address: http://www.eclipse .org/
SelectEclipse IDE for Java Developers:
- ##Notepad++ :
Notepad++ is a free code editor under the Microsoft Windows environment. Download address: http://notepad-plus-plus.org/
- Netbeans:
Open source free java IDE, download address: http://www.netbeans.org/
The video demonstration is as follows:
HelloWorld.java file code:
public class HelloWorld { public static void main(String []args) { System.out.println("Hello World"); } }