Written before:
I have read the basics of Java several times, but I forgot about it after a while, so this time I decided to spend some time organizing it. A series of blogs for easy reference in the future. This series is compiled based on two books on Java programming ideas + Java core technology. These two books are also two books that I highly recommend everyone to read, because each time you read them, you will get different results. The two books are horizontal. Seeing how they complement each other will definitely benefit you a lot, so stay tuned!
Section 1: Introduction to Java
##Java was developed by Sun in 1995 An object-oriented programming language launched in May, which implements the object-oriented theory extremely well, pays more attention to the object itself and does not need to pay too much attention to the process of events.
Java consists of four parts: Java programming language + Java class format file + Java virtual machine + Java application program interface. We define different class files through the IDE. Access the resource system by calling the class method (Java API), compile the source file into a .class file, and run the file through the Java virtual machine.
Java White Paper:
- Simplicity: The syntax is simple and easy to understand, eliminating C++ It is difficult to understand the header file pointers, etc. The class library is small, but as the class library increases and the thread support size increases, it is object-oriented: pay more attention to the object itself, and do not need to pay too much attention to the implementation process.
- 1991 In 2008, Sun was preparing to develop a device similar to a cable TV converter box, and the project was named: Green. The code is short and compact and has nothing to do with the platform. Based on the Pascal language, a virtual machine-generated intermediate code is designed for portability, namely the Java virtual machine
1994 Green Project (First Pascal Company) disbanded
May 23, 1995 Java on SunWorld After getting the demonstration, the great Java language was born
In early 1996, Sun released the first version of Java, but the Java1.0 version could not be actually used in development
Java 1.2 version (Standard Edition-J2SE-JavaSE) was released in December 1998. This version is closer to Java's write once and run anywhere concept and was released three days later ( Micro Edition-J2ME-JavaME) and (Enterprise Edition-J2EE-JavaEE)
Released Java1.3 in 2000
Java 1.4 was released in 2002
In 2004, Java made major improvements to the language, which can be described as another major improvement Milestone, and officially named Java 5.0 version, and adding concepts such as generics, foreach loops, enumerations, etc.
Released Java 6 version in 2006
In 2009, Sun's once glorious empire finally fell. After being acquired by Oracle, Java entered a period of stagnation
Java 7 version released in 2011
Java 8 version released in 2014
Section 3: Java development environment setup
JDK (Java Development Kit): Programmers who write Java programs Software used
JRE: Software used to run Java programs
-
IDE: Integrated development environment such as: eclipse, idea, etc.
JDK download address:. Note: The default installation path is under Program Files. It is best to change the path or replace the spaces to avoid unnecessary trouble.
Directory Structure:
bin: Compiler and tools
db: Relational database file developed by Java
include: File used to compile native methods
javafx-src: JavaFX Script is a declarative, statically typed programming language
jre: Java runtime environment file
##lib: Class library file
src: Class library source file
JAVA_HOME: D:\Java\jdk1.8.0_31 It points to the jdk installation directory. Software such as Eclipse/NetBeans/Tomcat searches for the JAVA_HOME variable to find and use the installed jdk.
PATH: %JAVA_HOME%\bin; Its function is to specify the command search path. When executing a command such as javac on the command line to compile a java program, it will go to the path specified by the PATH variable. Search to see if you can find the corresponding command program. We need to add the bin directory under the jdk installation directory to the existing PATH variable. The bin directory contains frequently used executable files such as javac/java/javadoc. After setting the PATH variable, you can enter it in any directory. Execute javac/java and other tools.
CLASSPATH: .;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar is used to specify the class search path. To use the already written class, The prerequisite is of course that they can be found. The JVM uses CLASSPATH to find classes. We need to set dt.jar and tools.jar in the lib subdirectory under the jdk installation directory to CLASSPATH. Of course, the current directory "." must also be added to this variable.
Environment variable verification:
CMD verification: Enter Java -version and press Enter. The console will output the jdk version number, indicating that the installation is successful. Create a new HelloWorld.java file, enter the corresponding directory, enter javac HelloWorld.java and press Enter, then enter java HelloWorld and press Enter to output Hello World on the console, indicating that the environment variables are configured successfully. Note: The javac program is a Java compiler. It compiles HelloWorld.Java into a HelloWorld.class file and sends it to the Java virtual machine. The virtual machine executes the compiler and places it in the class file. bytecode. Note: When compiling, you need to provide a suffix for the file to be compiled, namely: HelloWorld.java, and when running, you only need to specify the class name, and no suffix is required: HelloWorld. .
The above is the detailed content of Java overview + environment construction. For more information, please follow other related articles on the PHP Chinese website!

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor