Deploy Java Web Project with Jetty


1. Jetty installation

1, jetty

 Download from the official website:
 jetty-distribution-8.1.15.v20140411

jetty-distribution-9.2.9.v20150224 .zip

Extract jetty directly to its own directory (you can move it to other places by yourself)

2, jdk configuration

Install versionjdk-8u131-macosx-x64.dmg

The default installation address is as follows: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/< br>

Open the ~/.bash_profile file, create it if not, add the configuration at the end, so that maven can find the java directory

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Homeexport JAVA_HOM EPATH=$JAVA_HOME/bin:$PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

3, maven installation configuration

Check if maven is installed 
mvn -version

3.1 Download:

apache-maven-3.0.3-bin.tar.gz

3.2 Unzip, move to your own program directory, and add to path

mv apache-maven-3.0.3 ~/Programs/ / Then add the installation path to .bash_profile-------vi ~/.bash_profile //  is your installation directory---------export PATH=$PATH:/bin // Then source the profile file and check if the installation is successful source ~/.bash_profilemvn -version

3.3 Configuration

< /p>

Configure the download dependency address.

If the settings.xml file does not exist, create one. 

Configuration settings.xml initial configuration


p>

Second, deploy the Java Web project

1. Use maven to type the project into a war package: mvn -U clean compile package

2. Copy xxx-1.0-SNAPSHOT.war in the target directory to Jetty’s decompression path, such as: /Users/xxx/Downloads/jetty-distribution-9.3.5.v20151012/webapps< /p>

3, cd to the Jetty decompression path, such as: /Users/xxx/Downloads/jetty-distribution-9.3.5.v20151012

4, execute Java -jar start.jar

p>

5. Visit http://localhost:8080/xxx-1.0-SNAPSHOT/

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4586 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.