Java overview + environment construction
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!

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Guide to Smith Number in Java. Here we discuss the Definition, How to check smith number in Java? example with code implementation.

In this article, we have kept the most asked Java Spring Interview Questions with their detailed answers. So that you can crack the interview.

Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is

Guide to TimeStamp to Date in Java. Here we also discuss the introduction and how to convert timestamp to date in java along with examples.

Capsules are three-dimensional geometric figures, composed of a cylinder and a hemisphere at both ends. The volume of the capsule can be calculated by adding the volume of the cylinder and the volume of the hemisphere at both ends. This tutorial will discuss how to calculate the volume of a given capsule in Java using different methods. Capsule volume formula The formula for capsule volume is as follows: Capsule volume = Cylindrical volume Volume Two hemisphere volume in, r: The radius of the hemisphere. h: The height of the cylinder (excluding the hemisphere). Example 1 enter Radius = 5 units Height = 10 units Output Volume = 1570.8 cubic units explain Calculate volume using formula: Volume = π × r2 × h (4

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

Java is a popular programming language that can be learned by both beginners and experienced developers. This tutorial starts with basic concepts and progresses through advanced topics. After installing the Java Development Kit, you can practice programming by creating a simple "Hello, World!" program. After you understand the code, use the command prompt to compile and run the program, and "Hello, World!" will be output on the console. Learning Java starts your programming journey, and as your mastery deepens, you can create more complex applications.
