Latest web development tutorials

Java development environment configuration

In this section we will show you how to build a Java development environment.


window installation java

Download JDK

First we need to download the java development kit JDK, download address: http://www.oracle.com/technetwork/java/javase/downloads/index.html , click on the download button below:

In the download page, you need to accept the license, and select the appropriate version according to their own systems, this paper Window 64-bit systems as an example:

After downloading JDK installation according to prompts, and when installed JDK will install the JRE, be installed on it.

Installed JDK, during the installation process can customize the installation directory and other information, for example, we select the installation directory is C: \ Program Files (x86) \ Java \ jdk1.8.0_91.

Configuration environment variable

1. After the installation is complete, right-click "My Computer", click "Properties", select "Advanced System Settings";

2. Select the "Advanced" tab, click on the "Environment Variables";

Then the screen will appear as shown below:

Set three properties in the "System Variables", JAVA_HOME, PATH, CLASSPATH (capitalization does not matter), If there is already click the "Edit" does not exist, click "New."

Variable setting parameters are as follows:

  • Variable name: JAVA_HOME
  • Variable value: C: \ Program Files (x86 ) \ Java \ jdk1.8.0_91 // To configure according to their actual path
  • Variable name: CLASSPATH
  • Variable values:;.% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ tools.jar; // in front of a recall. ""
  • Variable name: Path
  • Variable value:% JAVA_HOME% \ bin;% JAVA_HOME% \ jre \ bin;

Setting JAVA_HOME

PATH settings

CLASSPATH settings

This is a Java environment configuration, the configuration is complete, you can start the Eclipse to write code that will automatically configure the java environment.

NOTE: If you are using 1.5 or higher JDK, do not set the CLASSPATH environment variable to be properly compile and run Java programs.

JDK is installed successfully test

1. "Start" -> "Run", type "cmd";

2, type the command: java -version, java, javac several commands, the following message appears, indicating that the environment variable configuration is successful;


Linux, UNIX, Solaris, FreeBSD environment variable settings

PATH environment variable should be set to point to the location of the Java binaries installed. If you have difficulty, refer to shell documentation.

For example, suppose you use bash as the shell, you can add the following to the end of your .bashrc file: export PATH = / path / to / java: $ PATH


Popular JAVA Development Tools

The so-called 工欲善其事必先利其器, we also need good money by development tools, IDE currently on the market a lot, we recommend the following article for the next several java java language development tools in the development process:


Using Eclipse to run a Java program first

Video presentation is as follows:

HelloWorld.java file code:

public class HelloWorld {
    public static void main(String []args) {
       System.out.println("Hello World");
    }
}