Linux[JavaEE]——Building a JavaEE development environment (with software installation tutorial and download address)

When developing JavaEE in the Linux operating system, to build a complete java development environment, you need to install the following 5 softwareThe download address of each software is attached at the end of the article.

  1. CentOS (already installed in the previous introduction)
  2. ideaIU
  3. apache-tomcat
  4. mysql (network download)
  5. jdk

As shown in the picture below, I have downloaded all the required software to Windows. Next, I will use the file transfer tool Xftp 7 to transfer the files to the Linux operating system for installation:

Table of contents

1. CentOS installation

2. jdk installation

3. Tomcat installation

4. Idea installation

5. MySQL installation

1. CentOS installation

For CentOS installation, please refer to Linux Getting Started (Comes with virtual machine VMware and CentOS download addresses and installation tutorials)

Linux [Getting Started] – Overview, virtual machine creation, environment configuration, installation and use of vmtools, use of shared folders_Developer Xiaoma’s Blog-BlogThis article introduces the introduction to Linux, including an overview of Linux, the establishment of a vm virtual machine environment, related operations of the virtual machine, downloading of vmware tools, and how to set up shared folders.

2. jdk installation

1. First create a directory to store jdk; [mkdir /opt/jdk]

2. Use the software xftp 7 to upload the installed jdk software to the /opt/jdk directory;

3. Unzip the file; [tar -zxvf file]

The decompressed file name can be viewed using ls, here it is jdk1.8.0_261 (the file names are not uniform, please check the file name after decompression);

4. Create a new directory /usr/local/java to store the decompressed files; [mkdir /usr/local/java]

5. Move the decompressed files to the java directory; [mv jdk1.8.0_261/ /usr/local/java/]

As shown below, the jdk software already exists in the java directory;

6. Configure the configuration file for environment variables and configure a JAVA HOME environment variable; [vim /etc/profile]

vim, enter the last line of /etc/profile, add the following two sentences and save;

export JAVA_HOME=/usr/local/java/jdk1.8.0_261
export PATH=$JAVA_HOME/bin:$PATH

7. Refresh environment variables; [source /etc/profile]

After performing the above operations, although new environment variables are configured, the system has not been updated, so it is still unusable. At this time, the environment variables need to be refreshed to make the new environment variables take effect;

At this point, the Java environment has been installed, as shown below;

8. Test the installation.

Write a file;

Compile the file and run the file;

The Java file runs successfully and the jdk installation is completed!

3. Tomcat installation

1. Create a new directory to store the tomcat compressed package; [mkdir /opt/tomcat]

2. Upload the compressed package to the tomcat directory in the Linux system;

3. Unzip the file; [tar -zxvf apache-tomcat-8.5.59.tar.gz]

As shown below, the decompressed directory name is apache-tomcat-8.5.59;

4. Enter the bin/ directory in the decompression directory and find the tomcat executable file file;

5. Run the executable file in the current bin directory, and tomcat has been started;

6. Open port 8080 and enter the following command;

firewall-cmd --permanent --add-port=8080/tcp //Open port

firewall-cmd --reload //Reload

firewall-cmd --permanent --query-port=8080/tcp //Query whether a port is open

7. Test whether tomcat can run;

Access tomcat in Linux in Windows operating system. If the following interface appears, tomcat can be used normally;

Tomcat installation is complete!

4. Idea installation

1. Create a new directory to store the idea compressed package; [mkdir /opt/idea]

2. Upload the compressed package to the idea directory in the Linux system;

3. Unzip the file; [tar -zxvf ideaIU-2018.3.5.tar.gz]

As shown in the figure, the decompressed file is idea-IU-183.5912.21;

4. Enter the bin directory of the decompressed directory and find the script file;

5. Execute script file; [./idea/sh]

Note that executing this file requires a Linux operating system and cannot be run on remote login Xshell.

After running the command, the following pop-up box will appear, select “Continue”;

Here I choose the trial version;

The initial interface of idea is as follows;

6. Test whether the idea can run normally;

Select “New Project”, jdk will be automatically recognized here;

If it is not automatically recognized, first check whether jdk has been installed correctly and configure environment variables. Use the commands javac and java respectively. If “the command was not found” is displayed, there is a problem with the jdk configuration;

If the jdk configuration is correct, re-use the command in this terminalsource /etc/profileRefresh the environment variables before starting the idea (valid in Xiaoma’s actual test);

Click Next, enter the project name and create;

Create a new Java file in the project src directory;

Enter a simple Java program;

Right-click the mouse and click Run;

The running results are as follows;

IDEA installation is complete!

5. MySQL installation

1. Create a new directory /opt/mysql and enter the directory;

2. Use the command network in the terminal to obtain the MySQL installation package;


The content is relatively large. If you already have a compressed package, you can use Xftp to upload it;

After the download is completed, view the following;

3. Decompress the MySQL compressed package; [tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar]

After decompression, MySQL contains the following packages;

4. Uninstall the mariadb database;

You need to know that the database that comes with CentOS is mariadb, which conflicts with MySQL, so it needs to be deleted;

First use the commandrpm -qa|grep mari, query mariadb related installation packages;

Then delete these mariadb installation packages and use the commandrpm -e –nodeps package name

5. Install MySQL and run the following commands in sequence;

rpm -ivh mysql-community-common-5.7.26-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.26-1.e17.x86_64.rpm
rpm -ivh mysql-community-client-5.7.26-1.e17.x86_64.rpm
rpm -ivh mysql-community-server-5.7.26-1.e17.x86_64.rpm

An error may be reported when directly copying the above command and running it. Method: Delete the package name after -ivh, go to the MySQL directory, copy the same package name and paste it here, and it will succeed; don’t ask why, it works~

6. Run systemctl start mysqld.service to start MySQL;

7. Set user password for root;

MySQL will automatically set a random password for the root user, and you can run the commandgrep “password” /var/log/mysqld.logView current password;

then runmysql -u root -p, log in as the root user, and the login password is the random password you just queried;

To set the password policy after successful login, use the commandset global validate_password_policy=0

The default password policy is 1, 0 – low, 1 – medium, 2 – high.

Use instructionsset password for ‘root’@’localhost’ =password(‘new password’);Set a new password;

Use instructionsflush privileges;Make the new password effective.

8. MySQL is created;

At this point, the JavaEE environment in the Linux operating system is set up!

Software download address:

Related Posts

[Resolved]Error: Failed to download metadata for repo ‘appstream’ : Cannot prepare internal mirrorlist

node npm upgrade

ESXI 7.0 version configures N card graphics card pass-through

7 tools that can replace the top command

Use the make tool to compile all .c in any directory and link & specify the output directory

iOS Code Coverage (2) – Incremental Coverage Automation Practice

HarmonyOS IoT device kernel programming interface—–Message queue

Tutorial on quickly setting up a java back-end development environment with Docker (detailed graphic and text combination)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>