IDEA from zero to proficient (37) imports web projects developed by IDEA

About the Author

Author name: Programming Ming Ming Shiyin
Introduction: CSDN blog expert, has been engaged in software development for many years, proficient in Java, JavaScript, bloggers also learn and grow step by step from scratch, know the importance of learning and accumulation, and like to play with the majority of ADCs Wild Upgrade, welcome your attention, and look forward to learning, growing, and taking off with you!

introduction

I was an old programmer who used eclipse and myeclipse all the time. Many of my fans said they wanted to use ideas and asked me why I didn’t use ideas. I learned more Java knowledge and practiced more, but as a fan fan, how could I refuse the request of fans, so I secretly learned a wave (bring it to you), and then wrote this series, I hope Friends can gain something, Brother Ming will work hard to update.

navigation

✪ IDEA from zero to proficient directory index
◄Previous [36] Quickly return to the location of the last code
►Next [38] Optimize memory settings and increase startup speed

overview

If you import a web project developed by others in IDEA, here I will explain the steps in detail. Of course, the method will be slightly different for different frameworks and scenarios, but the general direction is similar.

1. Import project

  1. Select Import on the welcome screen

insert image description here
2. Select the root directory of the code
3. Open the project structure

insert image description here

  1. Check the jdk version and output directory, I usually use jdk1.6 1.8

insert image description here

insert image description here

  1. Check the library file, if not, add it yourself, pay attention to the path

insert image description here

  1. Configure tomcat, for example, it used to be 7, but now there is no 7, as long as 6, it needs to be reconfigured ( note here that if it is tomcat6, jdk cannot be configured with 1.8, it must be configured as 1.6, 1.8tomcat6 does not support it, and it will be encountered later in the article )

insert image description here
This is a red flag, so it needs to be reconfigured
insert image description here

Configure the correct tomcat and modify the name
insert image description here

Check deployment
insert image description here

  1. If the javax.servlet.http package does not exist, you need to reset tomcat
    insert image description here
  • Open the project structure, select the Modules option, then select your project, select Dependencies on the right, add the correct tomcat configuration, delete the red and useless tomcat7, and then apply the settings (if the application does not take effect, rebuild the project) .
    insert image description here

Second, modify the database configuration

Look at my own situation, I use c3p0 here, and modify it accordingly

insert image description here
Build a database and create tables

insert image description here

3. Start tomcat

insert image description here

An error occurred

org.apache.jasper.compiler.JDTCompiler$1 findType
严重: Compilation error
org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException

It turns out that tomcat6 does not support jdk1.8, which is very embarrassing. It is also possible to download a tomcat7, or to modify the compilation environment of jdk, depending on your preferences.

What I use here is to modify jdk to 1.6 (there are several places to modify)

insert image description here

insert image description here

insert image description here
Recompile the project
insert image description here

Restart tomcat6, then enter the address to access
insert image description here

summary

This section summarizes "Importing web projects developed by IDEA", I hope it can be helpful to everyone, please help [Like] + [Favorite] + [Punch in the comment area] If you are interested in learning Java with Xiaoming Yes, [follow a wave] Don't get lost.

Please go to the bottom of the article to help [One-click three links] Thank you!

insert image description here

navigation

✪ IDEA from zero to proficient directory index
◄Previous [36] Quickly return to the location of the last code
►Next [38] Optimize memory settings and increase startup speed

Popular column recommendation

【1】Java mini-games (Tetris, Plants vs. Zombies, etc.)
2】JavaWeb project combat (library management, dormitory management, etc.)
【3】JavaScript wonderful examples (aircraft wars, verification codes, etc.)
200 cases
[5] Learn Java from zero, learn Java with fun
[6] IDEA from zero to proficient
insert image description here

Guess you like

Origin blog.csdn.net/dkm123456/article/details/123752575