Rookie achievement Data path--------Java overview

Source: Internet
Author: User

Always want to find time to write a blog, tidy up your thoughts. Also calm the increasingly impetuous heart. From this day on, I will often record here the process of learning big data. Do not ask for one article per day, but for the sake of a classic article. Okay, no more nonsense, get to the point.



<----------------------------------Gorgeous split-line------------------------------------------->

First, the Computer Foundation and Windows common shortcut keys:

Software: A collection of computer data and instructions organized in a specific order.

Common software are: Thunderbolt, qq,dos,linux,windows, etc.

The advent of software has achieved better interaction between people and computers, and there are usually two ways of interacting:

|---Graphical interactions such as: Windows,qq,ie

|---command line interaction such as: Dos,linux, etc.

As open source software more and more popular, Linux and other open-source operating systems in the industry is more and more widely used, although the graphical interactive way easy to use, but as a novice aspiring to become a master, still need to be familiar with the command line Interactive way. Let's take a look at the DOS operation instructions under Windows:

|----------DOS Operation instructions

1,dir: Lists all files and folders in the current directory

2,d:: Enter D: Disk directory

3,tab: Auto-complete, add a tab

|--Reverse Operation: Shift+tab,shift represents the meaning of the conversion,

4,CD: Enter directory

5, MD: Creating a Directory

6,RD: Deleting a directory

7,CD. : Back to the top level directory

8,cd\: Go back to the root directory

9,del: Deleting files

10,exit: Launch DOS command line

|------------Windows shortcut keys

Ctrl + C//Copy

Ctrl + V//paste

Ctrl + x//Cut

Ctrl + a//Select All

Ctrl + Z//Undo

Ctrl + y//Cancel last Undo

Ctrl + S//Save

'//reference identifier

tab//tab

Shift + TAB//Reverse action

ALT + TAB//Toggle Window

SHIFT + ALT + TAB//Reverse Switch window

windows + D//Open Desktop

[]

Windows + R: Run

services.msc//Services

Notepad//Notepad

Calc//Calculator

mspaint//Drawing

regedit//Registration Form


End//position cursor to end of line

Home//position cursor to beginning of line

SHIFT + END//Select the current position to the industry character

Ctrl + ARROW keys //progression by Word


\r//return

\//line

\t//tab


Here are some common commands that are very similar to those in Linux. People communicate through the language, the computer is the same, the following begins to introduce Java


Second, Java Introduction


Java is Sun (Stanforduniversity network, Stanford University Internet company)

The father of Java-James Goslin (James Gosling)

A high-level programming language introduced in 1995. is an Internet-facing programming language.

With the continuous maturation of Java technology, we have become the preferred development language for Web applications.

Is easy to learn, completely object-oriented, safe and reliable, platform-independent programming language.

Three technical architectures for the Java language:


EE (Java 2 Platform Enterprise Edition) Corporate Edition.

is a set of solutions for developing applications in an enterprise environment.


The technologies included in the technology system, such as Servlet JSP, are mainly for Web application development.


J2SE (Standard).


J2SE (Java 2 platrom standard Editon).


is a solution for developing common desktop and business applications.


The technology system is the basis of the other two, you can complete the development of some desktop applications.


Like the Java version of Minesweeper.



J2ME (small).

J2ME (Java 2 Platform Micro Edition) Small edition.

It is a solution for the development of electronic consumer products and embedded devices.

The technology system is mainly used in small electronic consumer products, such as mobile phone applications.


JAVA can be run on different platform systems. Compile once and run everywhere.

Rationale: JVM (Java virtual machine) virtual machines. The JVM is responsible for the operation of the Java program in the system. The JVM is non-cross-platform, and we know that there are JDK downloads for different operating systems on the Oracle website, and Java programs can cross platforms because the JVM is not cross-platform. JVM is a sandbox, Java program compiled bytecode files can be run on the JVM, so it can be compiled once, run everywhere.


JDK (Java Development Kit): Java Developer Kit

JRE (Java Runtime Environment): Java Runtime Environment

JVM (Java Virtual machine): Java VM

Where the JDK contains the JRE and some development tools,

The JRE contains some of the core class libraries required by the JVM and Java programs.



Third, the Java environment construction

|--first is to download the JDK, the latest version is JDK 1.8, it is recommended to use the latest.

|--followed by installation, here is the main explanation of Windows version of the installation, Linux installation more simple, specific details of Baidu itself.

1, after running the JDK installer, you need to change the JDK path, one thing to note is that the JDK installer will install the JDK before installing the JRE, so the two need to put in two different directory installation. For example, D:\JAVA\JDK and D:\java\jre two directories. Of course, we already know that the JRE is already included in the JDK, so you can skip the JRE installation step.

|--Next is the environment variable configuration:

Advanced into the computer (right-click)-Properties-Advanced system settings-environment variables

1, first in order to avoid we often manually fill out the directory information such as the letter, the configuration of a java_home variable, the value of the JDK installation path

2, in order to use some of the JAVA and Javac commands in any directory, these executables are usually in the bin directory, we need to append the directory to the path variable, the value is%java_home%\bin, (using the HOME and end keys to reach the beginning and end respectively)

%java_home% represents the value to take java_home.

3, in the future Java program running process, our program may need to use some core class library, as well as the call between classes, so we need to tell Java which path to find these class files, and the order of what to look for. Here we introduce the method of permanent setting, the new variable classpath, the value is

"%java_home%\lib\dt.jar; Java_home\lib\tools.jar;. " Be careful not to miss the "." In the back to indicate the current path.

Here, the environment variable has been set to complete, we open the DOS command line verification, (run >cmd>)

Input Java-version

Javac

The setting succeeds if no error message appears. The error needs to be examined in detail in the above three steps, mainly the path to match the wrong.


Next we can come up with a HelloWorld program,

public class HelloWorld

{

public static void Main (string[] args)

{

System.out.println ("hello,world!");

}

}

It is important to note that Java inherits the C and C + + styles, is a strongly typed language, with {} or, as a terminator.

In addition, when class is modified by public, the class name must be the same as the file name, or the error will be.

If you change the above file name to Haha.java, the compilation will error.



Next, let's talk about the temporary setting of environment variables.

Temporary configuration: Completed by the SET command in DOS command

Set: Information that is used to view all environment variables for this machine.

Set Variable name: View the value of a specific environment variable.

Set Variable name =: Clears the value of an environment variable.

Set Variable name = specific value: Defines the specific value for the specified variable.

Want to add a new value based on the original environment variable value?

First, the value of the original environment variable is obtained by the% variable name% operator.

Then add the new value and define it to the variable name.

Example: Adding a new value to the PATH environment variable

Set path= new value;%path%

Note: This configuration only works in the current DOS window. The window closes and the configuration disappears.


%path% dynamic configuration of the original path location

Path: Look in the current path first, and then go to path under path to find it.

CLASSPATH: First look under the specified path, not found in the go to the current path.



The order in which the JVM looks for class files:

If the CLASSPATH environment variable is not configured, the JVM finds only the class file to run under the current directory.

If the CLASSPATH environment is configured, the JVM will first look for the class file to run in the directory of the CLASSPATH environment variable value.

At the end of the value, if you add a semicolon, the JVM does not find the class file to be specified in the Classpath directory, which is looked up in the current directory.

If there is no semicolon at the end of the value, the JVM does not find the class file to be specified in the Classpath directory and does not look in the current directory, even if it is present in the directory.

Recommendation: When configuring the CLASSPATH environment variable, do not add a semicolon at the end of the value, or use "." If you need access to the current directory. Said.

<------------------------------------Gorgeous split-line--------------------------------------->

This article from "Rookie Achievement Data Road" blog, reproduced please contact the author!

Rookie achievement Data path--------Java overview

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.