Java Development Environment configuration, java Development Environment

Source: Internet
Author: User
Tags netbeans

Java Development Environment configuration, java Development Environment

JVM (Java Virtual Machine-Java Virtual Machine)

JRE (Java Runtime Environment-Java Runtime Environment)

JDK (Java Development kit-Java Development kit)

Windows system installation java download JDK

JDK includes JRE and JVM, so after JDK is installed, JRE and JVM are installed.

First, you need to download the java Development Kit JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html. Click here to download the volume:

On the download page, you must select to accept the license and select the corresponding version based on your system. In this article, the Windows 64-bit system is used as an example:

After the download, install the JDK as prompted. You can also install JRE when installing JDK.

Install JDK. You can customize the installation directory and other information during the installation process. For example, we select the installation directoryC: \ Program Files (x86) \ Java \ jdk1.8.0 _ 91.

Configure Environment Variables

JAVA_HOME configure JDK installation path

PATH: configure the JDK command file location

CLASSPATH configuration class library file location

In "system variables", set three attributes: JAVA_HOME, PATH, and CLASSPATH (Case Insensitive). if it already exists, click "edit". If it does not exist, click "new ".

1. My computer (right-click) --> Properties

2. Advanced System settings --> Environment Variables

3. The JAVA_HOME variable is not included in the System variable. Edit the variable as follows:

(The variable value is the JDK installation path)

4. PATH already exists in the system variable. Select PATH --> Edit

--> Enter the Bin path at the beginning (separate other paths with semicolons)

5. the built-in variables do not have CLASSPATH. You need to add

--> Use "." To represent the current path

--> Separated ";"

--> Enter the Bil path (for example, my path is C: \ Program Files \ Java \ jdk1.8.0 _ 60 \ lib)

 

  • Variable name:JAVA_HOME
  • Variable value: C: \ Java \ jdk1.8.0 _ 05 // You must configure it according to your actual path.
  • Variable name:CLASSPATH
  • Variable value:.; % JAVA_HOME % \ lib \ dt. jar; % JAVA_HOME % \ lib \ tools. jar // remember the previous "."
  • Variable name:Path
  • Variable value: % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin;

 

The configuration ends here. Remember to press OK. If you are not sure, it will not be saved by yourself.

This is the Java environment configuration. After the configuration is complete, you can start Eclipse to write code. It will automatically complete the java environment configuration.

Note:If JDK 1.5 or later is used, you can compile and run Java programs without setting the CLASSPATH environment variable.

Test whether JDK is successfully installed.

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

2. type the command:Java-version,Java,JavacThe following information is displayed, indicating that the environment variable is successfully configured;

Linux, UNIX, Solaris, And FreeBSD environment variable settings

The environment variable PATH should be set to point to the location where the Java binary file is installed. If it is difficult to set, see the shell documentation.

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

Popular JAVA Development Tools

As we call it, we must first sharpen the tool for doing better work. We also need to develop good development tools in the java language development process. There are many Ides on the market currently, this article recommends the following java development tools:

  • Eclipse (recommended ):Another free open source java IDE,: http://www.eclipse.org/

    SelectEclipse IDE for Java Developers:

  • Notepad ++:Notepad ++ is a free code editor in the Microsoft Windows environment: http://notepad-plus-plus.org/
  • Netbeans:Open Source Free java IDE,: http://www.netbeans.org/index.html
Use Eclipse to run the first Java program

The video demonstration is as follows:

HelloWorld. java file code:

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

Running Method 2:

Open cmd

Then run the command to go to the directory where you saved the file.

Run javac xxx. java

Then execute java xxx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.