In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to install linux to configure Java project running environment, for this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a simpler and easier way.
Tencent Cloud server is used:
1. Log in to Tencent Cloud
If you rent a server after logging in, click on the instance and there will be an airborne list. Click more reinstall system, select the system, reinstall, reinstall and set the password, and then you can use a third-party connection such as xshell. You need SMS verification code to connect to Tencent Cloud webpage login. I think it is a bit troublesome. This is the preparatory work.
two。 Go to the topic and configure the Java project runtime environment
Download and install jdk:
Make sure the system digits getconf LONG_BIT; before downloading mine is 64-bit jdk8, other versions go to the official website to download the linux version of https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Download link: https://pan.baidu.com/s/14mpxbTW8KeyRtkGUYEO2XQ
Extraction code: bq3f
Then use the tool xshell to upload jdk to the server
1: first connect to a Linux host
2: enter the rz command to see if lrzsz has been installed, and if not, execute the yum-y install lrzsz command to install it.
3: after the installation is successful, enter the rpm command to confirm that the installation is correct
4: use the rz-y command to upload the file, and the upload window will pop up: just select the jdk you downloaded
Decompress jdk,tar zcvf jdk-8u144-linux-x64
After decompressing, go to the etc directory and add the following command to vim / etc/profile at the end of the profile file:
Export JAVA_HOME=/root/java/jdk1.8.0_144
Export JRE_HOME=/root/java/jdk1.8.0_144/jre
Export
PATH=$PATH:/root/java/jdk1.8.0_144/bin
Export CLASSPATH=./:/root/java/jdk1.8.0_144/lib:/root/java/jdk1.8.0_144/jre/lib
Then save: add the following command at the end of the profile file: press the ESC key +':'(colon), type wq, and enter. (save changes to exit ": wq")
Java-version after restarting Linux:shutdown-r now
2.2 install tomcat:/root/java/tomcat/apache-tomcat-8.5.47
Rz-y upload tomcat
Decompress tar-zxvf apache-tomcat-8.5.47.tar.gz
Find the tomcat/bin directory and enter the command:. / startup.sh to open tomcat
Deploy the project to tomcat:
* war means configuring jdk, environment variable, and tomcat. Then put the project in tomcat. Web / ROOT
* the command is: java-jar xxx.jar
Linux operation jar
1. Java-jar xxx.jar / / ctrl + c can shut down the process
2. Java-jar xxx.jar & / / close ssh to shut down the process
3. Nohup java-jar xxx.jar & exit; / / can be run in the background. But you can't see the log. Netstat-nlp | grep: 8080 View process pid and then kill-9 pid
4.nohup java-jar xzgj.jar-> log.txt &, view log tail-f log.txt
Transfer the project, compress it into zip, and then transfer it to linux using the same rz. The location of the transfer is in ROOT under webapp under tomcat.
Extract the project, extract the project or interface to ROOT, use the command unzip project name, you can extract, and then visit, you can access the main page of the project, the name of the main page is index.html, otherwise you may visit the tomcat page.
Then you can enter the resolved domain name / project name in the browser to access the project.
This is the answer to the question about how to install linux and configure the running environment of the Java project. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.