IntelliJ idea Compiling method introduction and compiler setting and selection __ide Editor

Source: Internet
Author: User

IntelliJ Idea's compilation is more manual than real-time automatic compilation of Eclipse, although IntelliJ ideas can be set to turn on Just-in-time compilation, but it is too wasteful to do so. IntelliJ Idea Compilation method In addition to hand-click the Compile button to compile, you can also run the "container" before the configuration of a compilation event, compile and run. By default, IntelliJ idea is set this way, so in actual development, we don't have to pay much attention to compiling this thing. Although IntelliJ idea does not compile in real time (when not set), this does not affect the automatic checking of the code. However, the association between multiple classes, or to wait for build or rebuild trigger when the relevant check.

Callout 1:build project, compile the project, annotate the 2:build module, compile the module, annotate the 3:recomplie, recompile the class file, and Mark 4:rebuild projects to recompile.

As shown in the figure above, in IntelliJ idea, there are 3 ways to compile: build: Compile for the selected target (Project or Module), but only the modified file is compiled, and no modified files will be compiled. Recompile: A mandatory compilation of the selected target (Java class file), regardless of whether the target has been modified. Rebuild: Make a mandatory compilation of the selected target (project), regardless of whether the target was modified, and because Rebuild has only Project goals, it takes longer to Rebuild each time.

Next, let's look at the compilation before you run:

As shown in the figure above, IntelliJ idea defaults to a build operation before running the project.

So, let's take a look at IntelliJ idea compiler settings and selection:

Callout 1: Set up an automatic compile project, callout 2: Set compile-time heap size, callout 3: Set the VM parameters at compile time.

As shown in the figure above, we navigate to the "build, Execution, Deployment > Complie" page, and by checking the build project automatically shown in callout 1, we can set up IntelliJ idea to dynamic compilation; Callout 2 indicates that the compilation heap size is set, the default is 700, if you use a 64-bit machine, you can try to change it to 1500 or more if you have enough memory, in addition, if we quote a outofmemoryerror error at compile time, You can also modify (decrease) This parameter, and callout 3 indicates that you set up the virtual machine parameters at compile time, which can be personalized according to your requirements, usually by default.

As shown in the above illustration, we navigate to the "build, Execution, deployment > Compiler > Excludes" page, which can be compiled and excluded by clicking on + and-as shown in callout 1, any additions or deletions to directories (or files). When the project is compiled, if any of the compiled files are not compiled, then IntelliJ idea cannot be run, and the IntelliJ idea can run after all the problems have been resolved and compiled. However, it is possible that in the development process, the file compilation of a package directory can not pass, but we are not in a hurry to change, then we can consider to add the package to the exclusion compiled list, so that the project can be run.

Callout 1:use compile, callout 2:project bytecode version, callout 3:per-module bytecode version.

As shown in the figure above, we navigate to the "build, Execution, deployment > Compiler > Java Compiler" page, labeled 1 as the compiler supported by IntelliJ idea, including Javac, Eclipse , AJC, and so on, the default is Javac, also recommended to use Javac; Callout 2 is the compiled version for the project bytecode, typically the version of the current project master JDK, and callout 3 indicates that different bytecode can be set separately for the special needs of each module under project Version, of course, provided that the corresponding JDK version must be installed on our computer beforehand.

———— ☆☆☆--return to the simplest IntelliJ idea Tutorial <-directory--☆☆☆ in the history of-> ————

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.