In fact, most people know how to configure, but they don't know what the principle is. The following tutorial gives detailed steps and explanations
Original source Beginner's tutorial
Java Development Environment Configuration
In this section we will show you how to build a Java development environment.
Window System install Java download JDK
First we need to download the Java SDK jdk,:http://www.oracle.com/technetwork/java/javase/downloads/index.html, click the download button below:
In the download page you need to choose to accept the license and choose the corresponding version according to your own system, this article takes the Window 64-bit system as an example:
After downloading the JDK installation according to the prompts, as well as installing the JDK will also install the JRE, installed on it.
Install the JDK, you can customize the installation directory and other information, such as we choose to install directory C:\Program Files (x86) \java\jdk1.8.0_91.
Configuring Environment variables
1. After the installation is complete, right click on "My Computer", click "Properties", select "Advanced System Settings";
2. Select the "Advanced" tab and click on "Environment variables";
The screen will then appear as shown:
Set 3 properties in "System variable", Java_home,path,classpath (case does not matter), if already exist then click "Edit", not exist then click "New".
The variable setting parameters are as follows:
- Variable name:java_home
- Variable value:C:\Program Files (x86) \java\jdk1.8.0_91 //To be configured according to your actual path
- Variable name:CLASSPATH
- Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; Remember, there's a "." in front.
- Variable name:Path
- Variable value:%java_home%\bin;%java_home%\jre\bin;
Java_home settings
Path settings
CLASSPATH settings
This is the Java environment configuration, after the configuration is complete, you can start Eclipse to write code, it will automatically complete the configuration of the Java environment.
Note: If you use more than 1.5 versions of the JDK, you can compile and run the Java program normally without setting the CLASSPATH environment variable.
Test whether the JDK was 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 Settings
The environment variable path should be set to point to the location where the Java binaries are installed. If Setup encounters difficulties, refer to the shell documentation.
For example, if you use bash as your 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 工欲善其事 its prerequisite, we in the development of Java language process also need to be good development tools, the current market of many Ides, this article for you recommend the following several Java development tools:
Eclipse (Recommended): Another free open source Java IDE,: http://www.eclipse.org/
Select Eclipse IDE for Java developers:
- notepad++: notepad++ is a free code editor under the Microsoft Windows environment: http://notepad-plus-plus.org/
- Netbeans: Open Source free java IDE,: http://www.netbeans.org/index.html
Run the first Java program using Eclipse
The video demo looks like this:
Helloworld.java File Code:
Public Class HelloWorld { Public static void main (string []args) Span class= "Hl-code" > { Systemout. Println ( "hello World ") }} /span> Java Introduction Java Basic syntax
List of Notes
Easier x
[Email protected]
PathThe system is created, the directory where the. exe executable is stored, the bin directory can be configured for the JDK, and the Javac, Java, Javadoc commands in the directory can be used at any time.
ClassPathCreated by yourself, the directory where the. Class bytecode file is stored.
.; is the directory where the class bytecode file is located
Note: . Symbol is the current directory
Easier xEasier x
[Email protected]
- #1
Xiaoxiao Rain
[Email protected]
Path is the path where the command is stored.
classpath is the path to the storage class library.
Therefore, you need to find and reference java_home in the environment variable.
Path=%java_home%;%path%; Classpath=%java_home%\lib;%classpath%;
Http://www.runoob.com/java/java-environment-setup.html
Java Development Environment Configuration