Create a presentation (1) IDEA tool, installation, configuration and start the Java project

Understanding of IDEA

  • IDEA (https://www.jetbrains.com/idea/) is JetBrains company's products, as well as the company's other products, such as:

            WebStorm : for developing JavaScript, HTML5, CSS3 and other front-end technology
            PyCharm : for developing Python
            PhpStorm : for developing the PHP
            RubyMine : for developing the Ruby / the Rails
            AppCode : for developing in Objective - C / Swift
            Clion : Development for C / ++ C
            DataGrip : for the development of databases and SQL
            Rider : for the development of the .NET
            Goland : Go for development

  • IDEA, the full name of IntelliJ IDEA, a Java language integrated development environment, IDEA is recognized as one of the best java development tools in the industry, especially in the auto prompt intelligent code assist, code refactoring, J2EE support, Ant, JUnit, CVS integration, aspects of code review, innovative GUI design and other functions can be said to be exceptional.

IDEA's Main Functions

  • Language support:
    Here Insert Picture Description
  • Other support:
    Here Insert Picture Description

IDEA's main advantages :( compared to Eclipse)

1, strong integration capabilities. For example: Git, Maven, Spring, etc.

2, suggesting that the function of quickly and easily

3, suggesting a wide range of functions

4, easy to use keyboard shortcuts and code templates private static final psf

5, accurate search

IDE download and use

under the windows installation process

  • Pre-installation preparation:

      1, the hardware requirements (Hardware requirements) : Personal Recommended: 8G or more storage memory, the CPU i5 preferably more, preferably mounted SSDs (the SSD), IDEA mounted on the SSD, this will speed up a lot of fluency.

      2, the software required (Software requirements) : need to install JDK:
            new variable name "in the system variable the JAVA_HOME ", the value of the variable jdk installation path as: "C: \ Program Files \ Java \ jdk1.8.0_91";
            edit the variable name " Path ", at the end of the original face value of the variable plus ";% JAVA_HOME% \ bin; % JAVA_HOME% \ jre \ bin";

      3, the installation process (FIG truncated portion)

             Confirmed that 32-bit or 64-bit version
             confirm whether associated with the .java, .groovy, .kt format, where can choose not to associate.
Here Insert Picture Description

      4, installation summary

             From the installation point of view, IntelliJ IDEA hardware requirements does not seem very high. But in actual fact, development is not the case, because there are a lot of cache, the index file is executed IntelliJ IDEA, so if you are using Eclipse / MyEclipse, want to solve computer cards, slow and other issues through IntelliJ IDEA, which basically on it is not possible, you should upgrade your hardware in nature.

      5. Review the installation directory structure
Here Insert Picture Description

Where: bin directory, find idea64.exe.vmoptions (64 Wei IDEA of VM configuration file), if the 64-bit operating system and memory than 8G, if you are developing large-scale projects, Java projects or Android project, the proposed modification , it is often to modify the following three parameters:

-Xms128m, 16 G memory machines may try to set: (Setting of the initial number of memory, this value can be increased to increase the speed of Java programs start) -Xms512m

-Xmx750m, 16 G memory machines try to: -Xmx1500m (set the maximum amount of memory, increase this value, the frequency of collection Garage memory can be reduced to improve program performance)

-XX: ReservedCodeCacheSize = 240m, 16G memory machines to try: -XX: ReservedCodeCacheSize = 500m (retention of memory occupied by the code)

      6, view the settings directory structure
image

  • This is the directory where you saved the IDEA various configurations. This directory has a feature set, that is, after you delete the entire directory, and then restart IntelliJ IDEA will help you automatically generate a new default configuration, so a lot of time if you put IntelliJ IDEA configuration change is broken, it does not matter, delete the directory , everything will revert to the default

  • 1, config directory

     config directory is IntelliJ IDEA personalization of the configuration directory, or is the whole IDE settings directory. This directory can be regarded as the most important directories, not one, if you remember chapter describes the installation of the time, the old configuration directory on the installation of a new version of IntelliJ IDEA will automatically scan the hard disk, it refers to the directory. The main catalog record: IDE main configuration functions, custom code template definition, self-defined template file, self-defined shortcuts, Project records, etc. of tasks personalized settings.

  • 2, system directory

     IntelliJ IDEA system directory is a system file directory, IntelliJ IDEA is a bridge directory and development projects, which are: cache, index, container file output, etc., although not the most important directory, but the directory is also one of the most indispensable.

After starting the application is simple to configure

1, whether to import existing settings

  • First start, the following dialog box will pop up. Choose not to import existing settings.
    Here Insert Picture Description

2, activation

  • Baidu ide activation (activation code or modify the configuration file using jar package incorporated), or Taobao

3, set the theme

  • Here based on personal preferences, selection, you can also choose to skip (skip all and set defaults). In settings where the rear can also be re-set themes. Here Select: Next: Default plugins

4, set the plug
Here Insert Picture Description
Here Insert Picture Description

  • Set in a variety of plug-in IDEA, you can choose custom settings, delete, or install itself there is no plug-ins (such as: support for Scala plugin). Here is not set, the latter can also be set through settings interface menu bar.

  • IDEA plug-official Download: https://plugins.jetbrains.com/idea

Create a Java project

1. Create a Java
Here Insert Picture Description

  • New Project the Create : Create a new project
  • Project Import : import an existing project
  • Open : open an existing project. For example: You can open Eclipse project.
  • Version Control out from the Check : can project on the server address check out the project on Github above projects or other Git hosting server, here select Create New Project, need to be clear about the concept:

            IntelliJ IDEA is no similar workspace of Eclipse concept (Workspaces), the largest unit is the Project. Here can be understood as the Eclipse Project in Workspace.
Here Insert Picture Description

  • JDK select the specified directory as the Project SDK.

          If you want to create a Web project, you need to check the above Web Application. If you do not create a Web project, you do not need to check. Check here to not just create a simple Java project. Wherein selecting New: jdk installation path selection position where:

Here Insert Picture Description
2, set the display common view
Here Insert Picture Description
3, engineering interface display
Here Insert Picture Description

  • src similar project under the src directory under Eclipse, used to store code.
  • .idea and project01.iml files in the project are the IDEA project specific. Similar to the project under the Eclipse .settings, .classpath, .project and so on.

4, and create a package and class

  • Create a package in the src directory:
    Here Insert Picture Description
    Here Insert Picture Description
  • In the package new-class: whether to create a class, or interface, or annotation, select all new - java class.
    Here Insert Picture Description
    Here Insert Picture Description
  • Description: IDEA say in where that code is finished, do not click Save. IDEA will automatically save the code.

5. Create a module (Module)

  • In Eclipse we have the concept of Workspace (workspace) and Project (Project), the only concept in the IDEA Project (Project) and Module (module). Here is the correspondence between:

      IDEA's official website explained:

         An Eclipse workspace is similar to a project in IntelliJ IDEA
         An Eclipse project maps to a module in IntelliJ IDEA

         translation:

         The Eclipse workspace equivalent of the IDEA Project
         in Eclipse corresponds to IDEA Project in Module

This place beginning with the disarray will be very easy relationship between them.

  • From the turn of Eclipse always subconsciously want to be in the same window manager n items, which in IntelliJ IDEA can not do. IntelliJ IDEA provides solutions that open multiple project instances that have multiple projects open window. Namely: a Project Window open a window.

  • IntelliJ IDEA Project is in the top level, second level is the Module. A Project can have multiple Module. The current mainstream large-scale projects are deployed in a distributed, multi-Module structures are similar to this structure.
    Here Insert Picture Description
    Such projects are generally divided as, for example: core Module, web Module, plugin Module, solr Module and the like, between the modules may be dependent on each other. By naming these Module can also be seen between them are in a module in the same project business, there is an inseparable business relationship between each other.

  • Compared to multi-Module projects, small projects do not need to be so complicated. Only a Module structure IntelliJ IDEA is also supported, and IntelliJ IDEA to create a project, the default is the single Module structure. Here, we demonstrate how to create a Module:
    Here Insert Picture Description
    Here Insert Picture Description
    After that, we can write code in the Module of src, this time under the src Project engineering to no use. It can be removed.

6, how to remove the module
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
to delete this point, the module will be deleted from the hard this fall.

7, see the project configuration
Here Insert Picture Description
into the project structure:
Here Insert Picture Description
the next chapter, create and run (2) IDEA common configuration, project templates, and JavaWeb

Published 67 original articles · won praise 19 · views 9858

Guess you like

Origin blog.csdn.net/qq_41530004/article/details/104690951