Debian (Linux) building environment running Java Web Application

Time:2019-12-2

1. Build Java environment and configure JDK package

1. Uninstall openjdk from Debian Ubuntu

#Apt get remove openjdk * uninstall without removing the configuration

#Apt get purge openjdk * uninstall and delete related configuration

2. Copy jdk-7u5-linux-x64.tar.gz to the directory / usr / lib / JVM /. If there is no JVM folder here, create it,

 

Order:

Sudo MKDIR / usr / lib / JVM // create folder JVM

Sudo CP - R ~ / download / jdk-7u5-linux-x64.tar.gz / usr / lib / JVM // copy the downloaded file to Xinchuang

 

Under the created directory

Sudo tar - zxvf jdk-7u5-linux-x64.tar.gz // extract the file

3. Set the environment variable and open the / etc / profile file with GEDIT

sudo gedit /etc/profile
Add at the end of the file:

export JAVA_HOME=/usr/lib/jdk1.7.0_05

export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

4. Modify the default JDK of the system

$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_05/bin/java 300
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_05/bin/javac 300
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
5. Check and input java version
java version "1.7.0_05"

Java(TM) SE Runtime Environment (build 1.7.0_05-b05)

Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mo

2. Use the docker container to build MySQL and redis databases (I use the container (docker’s graphical management tool))
Debian (Linux) building environment running Java Web ApplicationDebian (Linux) building environment running Java Web Application

3. Initialize MySQL database through Navicat with the written. SQL file
4. Find the item in the folder directory and right-click to open the command line
Debian (Linux) building environment running Java Web Application

vim ITSDataSystem-1.0.0.jar

5. Enter the command / application.yml, find the file and enter
Debian (Linux) building environment running Java Web Application
Next, change the MySQL user name and password set up above; log path; URL IP + port number
Debian (Linux) building environment running Java Web Application
Finally, press ESC to exit editing mode, then: WQ to exit again: Q, and finally return to the page where the jar package is located
6. Start my project by command

/usr/lib/jvm/jdk1.8.0_131/bin/java -jar /home/gmx/Java/ITSDataSystem-1.0.0.jar

Debian (Linux) building environment running Java Web Application
7. Finally, open the browser and input IP + port + (/ route) to enter the Java Web page

Recommended Today

JavaScript (E5, 6) regular learning summary learning, can see can not see!

1. overview Regular expression is a method to express text pattern (string structure). There are two ways to create: One is to use literals, with slashes for start and end. var regex = /xyz/ The other is to use the regexp constructor. var regex = new RegExp(‘xyz’); The main difference between them is that the […]