Java Self-study note (first day) Install JAVA8---Configure the operating environment---write the "Hello World" program---Notes

Source: Internet
Author: User

(1) What are the JVM,JRE,JDK respectively:

Jvm:java Virtual machine (Java VM)

Jre:java runtime Environment, is the Java program's operating environment

JDK:JDK (Java Development Kit) is the Java language Software Development Kit

The JDK contains the JVM contained in the JRE,JRE

(2) Download, install Jdk8:

Try running Javac.exe under the bin directory in the JDK directory using the command prompt

There are no Javac.exe files in the bin directory under the JRE directory

Java8 the "Unable to locate the program input point regdeletekeyexa on the dynamic link library ADVAPI32.dll" When Windows XP is installed. ] Error.

Workaround: Place the downloaded Java installation package under the JDK path that will be installed, use the 7-zip Unzip tool to extract the installation package to the current directory to get the Tools.zip package, Fetch the Tools.zip again through 7-zip extract to the current directory to get the JDK file, open the Lib directory you will find the former Tools.jar into Tools.pack and jre/ Lib Rt.jar becomes rt.pack, so we need to return him to our familiar form, the Bin/unpack200.exe under the JDK is the tool for conversion, we just need to invoke the tool on the command line to perform the conversion. D:\jdk8>for/r% F in (*.pack) does "D:\jdk8\bin\unpack200.exe"-r-v "%f" "%~pf%~nf.jar" and then the conversion is complete. (Solution from Baidu)

(3) Configure the environment in which Java is running in the operating system:

My Computer-Properties-advanced-environment variables-Add a Java installation directory (D:\jdk\bin) to the system variable path, or create a new java_home system variable, set the value to be the Java installation directory D:\JDK, and dynamically acquire Java_ in the path system variable Value in Home (%java_home%\bin)

Configure temporary environment variables: Use the SET command on the cmd command line, set JAVA_HOME=D:\JDK

Temporary environment variables are only useful in the current window with set CMD and in a new window opened with this window (using the Start command),%xxx% dynamically gets the value in the system variable XXX

(4) *.java file (Java code) (Human programming language)-----> Compile--------> *.class files (Files run by Java virtual machines) using Bin\javac.exe (machine language)

Bin\java.exe Run the *.class file, if there are errors must be carefully reviewed, file directory and filename

(5) Error: Package system does not exist---->java classes are beginning with uppercase letters

(6) Class: is a keyword in Java that defines a class, and the Java language's program code needs to be defined in the class

Keywords: words that are given special meaning by the Java language

(7) Configuring CLASSPATH system variables: The purpose of setting up classpath is to tell the Java execution Environment, in which directories you can find the classes or packages (. class files, etc.) that you need to execute the Java program. its priority is higher than the directory where the *.class file resides

Set Classpath=d:\    and set classpath=d:\; The difference is the final semicolon, there is a semicolon to find the specified directory to find the current directory, no semicolon indicates that only the specified directory is not found in the current directory

Specifies multi-directory set classpath=.; D:\;c:\

(8) System variable path path specifies an. exe file

System variable Classpath path Specifies the. class file

After you configure a system variable, you can execute it in any directory of CMD, the file you want to execute

(9) CMD command line executable all. exe file------(parameter value setting for desktop shortcut)

(10) When defining the class name, the first letter of each word must be capitalized,

public static void Main (string[] args) {} Javac.exe compile error codes (such as Mian) without error, but Java.exe execute times wrong

(12) Tools--Folder Options--View--Hide extensions for known file types

Javac compile-time without distinguishing between. java file name capitalization

The Java runtime distinguishes between the case of a. class file name

(14)//single-line comment

/* * * Multi-line Comment multi-line comment not applied

/** */Documentation comments

Note Format 1. Requirements 2. Ideas 3. Steps

(EditPlus) Blue is the keyword red is the class

Java Self-study note (first day) Install JAVA8---Configure the operating environment---write the "Hello World" program---Notes

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.