search
HomeJavajavaTutorialBasic knowledge of java + environment construction and variable configuration

1. DOS command

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

Interaction mode: graphical interface, command line

dir directory displays files and subdirectories

cd change directory changes the current path (enter the specified directory)

md make directory creates a new subdirectory (folder)

rd remove directory Delete a subdirectory (folder)

cd.. Return to the previous folder

cd/ Return to the root directory (disk)

del delete Delete files (without going to the Recycle Bin) del *.txt (delete a certain file) All txt files in the directory)

ren rename

Note:

rd Delete a subdirectory (folder) (make sure there are no files in the directory. If there are files, directly using the "rd directory" command will not work. At this time, you can execute the del command on the directory, and then use the rd command to delete the directory. The advantage of this is that you do not need to change the path back and forth)

For example: There is a text document 1.txt under C:abcop, and you want to delete the op folder

Method 1:

First delete the text document C:abcop>del 1.txt

Back to abc The command

C:abc>del op will prompt to delete the files in the directory OK

C:abc>rd op

Complete deletion of the op directory, which is simpler than method 1

II. Java language overview

1. Java is a language that allows users to transfer applications from a remote server to a local machine through the Internet and execute them.

Features: Object-oriented, safe and reliable, independent of platform (operating system), portability

Principle: Just install a Java Virtual Machine JVM (Java Virtual Machine) on the platform that needs to run Java programs, and the JVM will do it Parse and execute Java run. (Virtual machines have different versions according to the operating system)

2. Three technical architectures of java language:

J2EE Enterprise Edition: It is a solution for developing applications in enterprise environments, technology Server Jsp Wait

J2SE Standard Edition: It is a solution provided for the development of ordinary desktop and morning applications, and can complete the development of some desktop applications.

J2ME Small Edition: A solution provided for the development of electronic consumer products and embedded devices. Mainly used in mobile applications.

The name was changed to JavaEE after Java 5.0. .

3. Environment construction

Download, install JRE, JDK, and configure environment variables.

JRE: Java Runtime Environment Java runtime environment, including Java virtual machine and core class libraries required for Java

Basic knowledge of java + environment construction and variable configurationJDK: Java Development Kit Java development package, including development tools and JRE, and the development tools include the compilation tool javac .exe, packaging tool jar.exe, etc.

1. Why does JDK include JRE?

First: Always run the developed program to see the effect;

Second: The development tools in the bin directory under the JDK are written in Java, and they need the support of the running environment virtual machine when running

2. Why do we need to do it? Java environment variable configuration

After installing the JDK, use the command line to enter the lib and execute the javac.exe program in the lib,

F:jdk1.6.0_24lib>javac. At this time, if you exit to the JDK F:jdk1 .6.0_24lib>cd.., and then execute javac.exe at this time, F:jdk1.6.0_24>javac will not succeed.

Question: Do I need to go to the lib directory every time I develop a program? The requirement is that commands can be executed in any directory.

The answer is: tell the system the path where the command tool is located, and let the system find it. It is more convenient to use the command, that is, java environment variable configuration.

3. Configuration skills

Sometimes the drive letter or name of jdk will be changed. Every time it is changed, it must be changed in the path to prevent misoperation to other configurations. You can use a configuration skill:

(1) use A new environment variable a to record the changed drive letter and file name: java_home=F:jdk1.6.0_24

(2) Get the value of a in path, and add the unchanged bin path=%java_home%bin

Note: The %% symbol is to dynamically obtain the value of an existing environment variable, so you only need to change the variable value. 4. Temporary configuration of environment variables

Use the dos set command (view or set Environment variable value)

C:>set path View the value of path

C:>set path=haha Set the value of path

At this time, the path value is haha, but open a dos again in the "Start" menu The window set path is still the previous value.

This means that the way to configure environment variables in dos is only valid in the current window. However, if you use the start command to open a new DOS window after configuration, this window will inherit the environment variable value of the original window.

In this configuration, the previous value of path is gone, only the newly configured one. What if you want to add a new value based on the path environment variable value?

You can use dynamic access to variable values: C:>set path=haha;%path%

Four. Hello World composition

Keywords: words given special meaning by the Java language, such as the class keyword that specifically defines classes , keywords can only be lowercase

1. Java writing standards

a. Class names must be meaningful words to increase readability

b. Class names consist of single letters, and the first letter of each word is capitalized

c , Braces define the class name interval

d. The content in the class must have a sense of ladder (often use the tab key)

e. All methods must end with;

2. Fixed main function writing method public static void main(String [] args){}, to ensure the independent operation of the class, why?

Because the java command will call the virtual machine, the virtual machine will use the low-level content of Windows and run the specified class. In the class, it will first find the specified function main and run it. That is to say, the virtual machine calls the main function in the class we specify and executes the code. The main function is the entrance to a program, ensuring that the class runs independently. Whichever class needs to be run, write the main function in it.

5. Java Document Comments

javadoc.exe in JDK can extract all the document comments in the program into a web page. This web page is the instruction manual of the written program.

1. The expression form of document comments: /**    */ is unique to java

In comments: // is used in a single line, /* */ is used in multiple lines, and there cannot be more than one in a multi-line comment Line comments can have single-line comments. These two comments will not be interpreted and executed by the JVM

2. Purpose of comments: 1. Comment description 2. Debugging the program

When writing a program, you should develop the habit of commenting frequently. Sort out your thoughts through comments first, and then use code to reflect them, because code is just a manifestation of thoughts.

When writing a new program:

1. Write notes first: a. Needs, requirements b. Ideas c. Steps


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
带你搞懂Java结构化数据处理开源库SPL带你搞懂Java结构化数据处理开源库SPLMay 24, 2022 pm 01:34 PM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于结构化数据处理开源库SPL的相关问题,下面就一起来看一下java下理想的结构化数据处理类库,希望对大家有帮助。

Java集合框架之PriorityQueue优先级队列Java集合框架之PriorityQueue优先级队列Jun 09, 2022 am 11:47 AM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于PriorityQueue优先级队列的相关知识,Java集合框架中提供了PriorityQueue和PriorityBlockingQueue两种类型的优先级队列,PriorityQueue是线程不安全的,PriorityBlockingQueue是线程安全的,下面一起来看一下,希望对大家有帮助。

完全掌握Java锁(图文解析)完全掌握Java锁(图文解析)Jun 14, 2022 am 11:47 AM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于java锁的相关问题,包括了独占锁、悲观锁、乐观锁、共享锁等等内容,下面一起来看一下,希望对大家有帮助。

一起聊聊Java多线程之线程安全问题一起聊聊Java多线程之线程安全问题Apr 21, 2022 pm 06:17 PM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于多线程的相关问题,包括了线程安装、线程加锁与线程不安全的原因、线程安全的标准类等等内容,希望对大家有帮助。

详细解析Java的this和super关键字详细解析Java的this和super关键字Apr 30, 2022 am 09:00 AM

本篇文章给大家带来了关于Java的相关知识,其中主要介绍了关于关键字中this和super的相关问题,以及他们的一些区别,下面一起来看一下,希望对大家有帮助。

Java基础归纳之枚举Java基础归纳之枚举May 26, 2022 am 11:50 AM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于枚举的相关问题,包括了枚举的基本操作、集合类对枚举的支持等等内容,下面一起来看一下,希望对大家有帮助。

java中封装是什么java中封装是什么May 16, 2019 pm 06:08 PM

封装是一种信息隐藏技术,是指一种将抽象性函式接口的实现细节部分包装、隐藏起来的方法;封装可以被认为是一个保护屏障,防止指定类的代码和数据被外部类定义的代码随机访问。封装可以通过关键字private,protected和public实现。

归纳整理JAVA装饰器模式(实例详解)归纳整理JAVA装饰器模式(实例详解)May 05, 2022 pm 06:48 PM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于设计模式的相关问题,主要将装饰器模式的相关内容,指在不改变现有对象结构的情况下,动态地给该对象增加一些职责的模式,希望对大家有帮助。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool