idea of the basic settings

1. idea.exe.vmoptions file, as you can modify ,,
  optimization principle is invoked to load more memory to run him, so if 4G itself is not enough, it will cause other applications very slow.

 

 

 2. The following are some basic configuration:
      View in the Toolbar first check, there will be a toolbar,

 

 

 

 

 

 Then click the little wrench,

1, system theme

Reflection is arranged in front of the main interface configuration: primary colors and the like may be provided herein.

 

 

 2, set the mouse suspended prompt
in Eclipse, we move the mouse over a class, the class of the document will be prompted to interpret information;
IDEA in default will not be so, we need to set the next; Editor-> General
check this option, the parameter It is on the time spent on the word. I set 1.5 seconds

 

 

 

3, the display method of the separator
is the separator between each method will be, it is a good look at the code.
Operation: Editor-> General -> Appearance check Show method separators

4, ignoring case prompted
IDEA default prompt is case-sensitive, such as the input string, not prompted String Class; here disposed under
Editor-> General -> Code Completion of the red box options can be removed.

 

 

 5, automatic guided package
default, including finished Eclipse classes, is the need to manually import the package, but the package is automatically turned IDEA provided disposed
Editor-> general-> Auto Import
drop-down selection box to check both ALL and then automatically guide package.

 

 

 

6, set the font
Editor-> Font
Here you can according to their preferences, set the font style, font size, line height, including

7, configuration, document annotation information template
default does not create a new class document annotation information, we generally developed under must engage in, easy to find someone.
Editor-> File and Code Templates Includes File Header then
the red box is the code you want to join.

 

 

 8, set the file encoding
Editor -> File Encodings unified all set to utf-8

 

 

 9, set up to automatically compile
in Eclipse, the project is automatically compiled, IDEA is not in default, we need configuration;
Build, Execution, Deployment - next> Compiler check two set automatically compile the project, including multiple parallel structures module automatically compile;
check both can be.

 

 

 

10, a shortcut into eclipse

Some people do not adapt IDEA shortcuts, so you can also change the shortcuts to suit your needs.
Keymap

 

 

 11, set the default browser
tools -> web browsers

 

 

 

Next is described a few keystrokes:
Alt + S, and Shift + alt + inster get set and automatically generate the constructor
ctrl + d deleted row
ctrl + shift + o import package
ctrl + shift + f code formatter
ctrl + shift + y change case
ctrl + f to find (current file)
Ctrl + H global Search
double-click the shift Find file
tab and shift + tab to move forward and backward overall Code
alt + / prompts (custom modifications)
alt + / shortcut is occupied elsewhere , so to get rid of;
search according shortcuts

Create a variety of basic items and configuration

1, Web Project

Web projects are similar and java project, choose a good JDK, but also to check a Web Application

 

 

 Then create JSP

 

 

 

 

 

 

To access it, you need to configure tomcat, click on the Add configuration interface

Click on the top left of the + sign choose Tomcat Server -> Local, red box to select your tomcat version, name can take the name of your tomcat.

 

 

 After the set can be seen in the interface server you set up, click on the right side of the triangle is run, and the second is to debug

 

 

 When you run, make changes to the code inside and then refresh your browser does not change, it is because there is no time to change the rules in the configuration of the server. Here are two instead update classes and resources on it.

 

 

 

2, Maven project

The first step is to configure Maven Maven project

 

 

 

 Maven address and choose your own settings
and choose Select Maven SDK check Create from archetype select maven-archetype-webapp click next.

 

 Then enter the name of your project, etc. Click next. Use this menu to note here is to select the directory you just equipped Maven, then click the + button below

 

 Then add a couple of key-value pairs, and then you can create.

 

 Once created, you will find him less as compared to the Eclipse two files,

 

 So you need to manually create,
select mainy right-click to create a folder,
create a folder name java java specialized storage file,

 

 Then mark it as a sources folder.
Then create a resource file resources in folders. Labeled Resources root folder.

 

 Maven then there is no sevlet default, so you have to set up their own,

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>4.0.1</version>
    <scope>provided</scope>
</dependency>

Replace junit here.

 

 When you have to click here to change the import Changes, after importing finished, you can test if any problems.

 

 Create a folder in java servlet file, webapp create a jsp

@WebServlet("/maven")
public class MavenDemo extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    };

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("Maven案例");
        req.getRequestDispatcher("/hello.jsp").forward(req,resp);
    };
}

Tomcat set and then turn the address bar plus maven test, if successful console appears Maven cases illustrate successful.

But there will be a problem, it is the servlet change the print value, and then save, run once and will not change.
There are two solutions for this situation, the first one is to restart the service,
the second is the use of jrebel plug.
In the settings, click Plugins -> Browse repositories button

 

 In it search jrebel

 

 

Then according to step JRebel hot deployment of the IDEA installed here.
When you click on the small hammer to change the compiler then refresh if the change is successful then OK.

(One drawback is the need to spend money this plugin before you can use)

Next is to add a virtual map, and maps on the same project, set in the tomcat, Artifact fill your true path, and then fill in the Application context is your virtual path, you can access the virtual path.

 

Guess you like

Origin www.cnblogs.com/qingmuchuanqi48/p/11541507.html