Java Development Environment Configuration

Source: Internet
Author: User

List Java Development Environment configuration1.1 Preface

The Java we learn is a kind of computer language. Java after more than 20 years of green years, gradually using one of the most programming languages, now many web pages and mobile applications are developed in the Java language, with the advent of new technologies such as big Data, Java will play a more and more extensive role, so choose to learn the Java language is necessary. To learn the Java language, you first install a JDK (the Java Virtual Machine JVM and the Java Development toolset).

installation of the 1.2 JDK

Java Three Specifications (specification: Some classes defined by Oracle, which can be used only by the user, without their own definition)

Javase the basics of the Java language for desktop applications, such as some small games.

Java EE is applied to javaweb for Web pages, such as Web background development.

Java me applies to some embedded devices, such as printers, but rarely.

Jdk1.8 Java Development Kit8

First, we can install the JDK after downloading it online.

Follow the steps below to install it.

First, double-click the JDK installation file to eject the following interface

The installation path of this Java Development Kit can be changed, if there is not enough space under the C system disk, you can change the installation path by clicking the switch key.

JDK (Java Development Kit: Contains a series of Java development tools)

These are the installation steps of the JDK.

JDK Directory Introduction

    1. Bin directory: A compiler, interpreter, and other tools (executables) that store java.
    2. DB directory: JDK7 comes with a lightweight database named Derby.
    3. Include directory: an interface file that holds the calling system resource.
    4. JRE Directory: Store Java Runtime Environment files.
    5. LIB directory: A class library file that holds java.
    6. Src.zip file: The source code for the class provided by the JDK.

1.3 environment variable configuration:

Why use Java to configure environment variables?

The Java Configuration environment variable is designed to run the Java Development Toolset under any path.

We must have Java development tools and Java source code to run Java programs. If you do not configure the environment variable, then Java source code must be stored in the JDK Bin directory, the operating system can find both Java development tools and Java sources. The purpose of configuring environment variables is to tell the console where to find Java development tools.

Configuration method: Computer-----? Properties----Advanced system Settings---------? advanced-----? environment Variables---------? path

Then find the JDK installation directory and go to the bin directory

Copy-and-paste the entire path is placed into the PATH environment variable.

To facilitate future Tomcat programming we can create a new java_home environment variable that is placed in the path of the JDK.

Only%java_home%/bin can be placed in path.

This prevents system errors by mistakenly deleting other system variables when modifying the path of the JDK in the path directory. And this is also the requirement to run the apache-tomcat-8.0.43 server, the server must be configured with Java_home environment variables to run.

Classpath path does not need to be set, it is completely unnecessary

Put%java_home%bin in Path;

Be sure to apply again. Then we can test it------click Window+r and type cmd in the pop-up window to open the window console, the input javac has the following interface display, the Java environment variable is configured successfully.

1.4 Common DOS commands for the console:

Drive letter (direct write disk such as c,d,e,f,g, press Enter): Enter the specified drive letter.

Dir: Lists the files and folders in the current directory

MD: Creating a Directory

RD: Delete directory Note: Rd cannot delete non-empty folders, and can only be used to delete folders.

CD: Enter the specified directory

CD: Back to top level directory

CD \: Go back to the root directory

echo "Hello java" >a.txt writing text to the specified file

Type a.txt display file contents command

Del: Delete file Note: You cannot delete a folder, only files can be deleted.

Exit: Launch DOS command line

CLS: Notifies the computer to empty the current command

+

*: is a wildcard character.

tab command completion.

The arrow keys are up and down to retrieve the last command you wrote.

1.5 First Java program

Public class Demo1 {

Public Static void Main (String[] args) {

System. out. println ("Hello java");

}

}

How to compile, run?

First open the console (window+r, re-enter CMD)

Then in the console window into the Java source file directory, my Java source file named Demo1.java on the desktop, so input CD desktop into the desktop directory

Enter compile command javac source file name

Then enter the Java class name of the execution command (the name of the class file after compiling the Java source file will be the custom class name after the first line of the code class keyword, not the Java source file name, when executing. class suffix does not have to be written)

If Javac is not an executable command, then there are two possibilities, one is that the PATH environment variable is not paired, and the other is that there is no JDK installed and the check is correct.

If the file is not found, there are two possibilities, one is the Java source file name is wrong, the second is to enter the directory to write the wrong, check and then correct.

Java Development Environment Configuration

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.