catalogs
Introduction to JDK
summary
Synopsis:Java Development Kit (JDK) is Sun’s (acquired by Oracle) software development kit for Java developers. Since the introduction of Java, the JDK has become the most widely used Java SDK (Software development kit).
Version Description
Learning environment, we usually use a newer version of the JDK, because we want to learn some of the new features of the development environment, we usually use an older version of the JDK (such as: JDK 8), because the older version of the stable and widely used check the official website address:http://www.oracle.com。
Basic components of the JDK
- javac:Compiler, converts source programs into bytecode.
- jar: packaging tool, the relevant class files are packaged into a file.
- javadoc: documentation generator , extract documentation from the source code comments .
- jdb: debugger, error tool.
Extension: JDK also includes the complete JRE (java runtime environment, Java runtime environment), also known as Private Runtime, contains a variety of class libraries for the product environment, as well as for the developer to use the complementary libraries, such as internationalization libraries, IDL libraries. JDK in the sea includes a variety of example programs to demonstrate the The JDK includes a variety of example programs to demonstrate various parts of the Java API.
Installation of JDK on windows
downloading
Official Download Address:https://www.oracle.com/java/technologies/downloads/archive/
Netflix download address (private):https://pan.baidu.com/s/1vnsevOfLb_66fOnLCZ7TDQ?pwd=2715 Extract code: 2715
note: The following is a tutorial using the official download link, if you use a private disk link to download the JDK directly jump to the installation step, you do not need to watch the following content.
Once you are on the download page, slide your mouse down to find Java SE downloads and select the JDK 8 version.
Find Java SE Development Kit XXX and click on the download link behind the Windows x86 Installer.
A download window pops up, just do the download.
Before downloading, you need to log in to your Oracle account first, if not, create an account and then log in, after logging in successfully, return to the download interface, download operation can be. (Registration steps omitted)
After successful download, get the executable file with .exe extension and right click to run it as administrator.
mounting
The installation process is also very simple and usually goes straight to the next step.
The default path is fine, change it to suit your needs.
Open the JDK installation path to view the JDK directory structure
Catalog description:
- bin: binary binary abbreviation, the storage is executable files. Such as: java.exe (Java compiler), java.exe (Java runtime tools), jar.exe (packaging tools) and javadoc.exe (document generation tools).
- db: the catalog is a small database, introduced in Java, an open source database management system – JavaDB. so there is no need to install additional database software when learning JDBC, you can use JavaDB directly.
- include: Since the JDK is implemented in C and C++, some C header files need to be introduced at startup, and this directory is used to store these header files.
- jre: “jre” is the abbreviation of “Java Runtime Environment”, which means “Java Runtime Environment”. This directory is the root directory of the Java Runtime Environment, which contains the Java Virtual Machine, runtime class packages, the Java Runtime Launcher, and a bin directory, but does not contain the development tools in the development environment.
- lib: is an abbreviation of “library”, meaning Java class libraries and library files, is an archive of package files used by development tools.
- src.zip and javafx-src.zip: placed in the JDK core class source code, through the file you can view the source code of the Java Foundation Classes
deployment
Step 1: Right click on “Computer” -> “Properties”.
Step 2: Click “Advanced System Settings” –> “Environment Variables”.
Step 3: Click New in System Variables, the variable name is JAVA_HOME, and the variable value is filled in the path of your JDK installation.
Step 3: Find Path in System Variables and double click on it, click New, add %JAVA_HOME%\bin
Step 4: After the configuration is complete, win + r to open the cmd command line window and enter the command:java -version
The following message appears to indicate that the installation and configuration is complete.
Installing the JDK on Linux
downloading
Official Download Address:https://www.oracle.com/java/technologies/downloads/archive/
Netflix download address (private):https://pan.baidu.com/s/1kEmm91icPtFWM_rz4RQK5A?pwd=2715 Extract code: 2715
note: The official address to download the way to refer to the above windows download tutorial, the download is Linux x64 Compressed Archive as shown below, if you use a private link to download, you can ignore this description.
mounting
Use a tool to connect to the VM remotely (here I’m using FinalShell), and I won’t go into much detail here as far as the tool is concerned.
Step 1: A new folder needs to be created to put the downloaded zip into it, execute the following lines of command.
cd /
mkdir -p /export/package
cd /export/package
As pictured:
Step 2: Upload the downloaded zip to your Linux system (here I use direct drag and drop uploading)
extensions: rz, sz commands can be uploaded and downloaded. rz, sz commands need to be installed.
With the command.yum -y install lrzsz
The following is an example of how to do this.
rz command for uploading. Syntax: Just type rz directly at the command line
sz command to download. Syntax: sz File to be downloaded
The file is automatically downloaded to the desktop in the folder: fsdownload
Step 3: Extract the file JDK to: /export/server and execute the following command:
mkdir /export/server
tar -zxvf jdk-8u361-linux-x64.tar.gz -C /export/server
As pictured:
Step 4: Check if there are unzipped files in the /export/server folder, if there is it means the installation was successful.
ll /export/server
As pictured:
deployment
Step 1: Configure environment variables and execute commands:vim /etc/profile
, add the following two lines of code, to the lowest end, then save and exit. Finally execute the command:source /etc/profile
Enables the configured environment to take effect.
export JAVA_HOME=/export/server/jdk1.8.0_361
export PATH=$PATH:$JAVA_HOME/bin
As pictured:
Step 2: Remove the JDK that came with your system and replace it with your own JDK.
rm -f /usr/bin/java
ln -s /export/server/jdk1.8.0_361/bin/java /usr/bin/java
As pictured:
Step 3: Console inputjava -version
The installation is now complete, thank you for watching!