官术网_书友最值得收藏!

Build the code and run it

The IDEs usually compile the code for analysis to help us spot syntax errors or undefined classes and methods on the fly. This compilation is usually partial, covering a part of the code, and as it runs all the time, the source code changes and is never actually complete. To create the deployable file, that is, the final deliverable code of the project, a separate build process has to be started. Most of the IDEs have some built-in tool for that, but it's not recommended to use these except for the smallest projects. Professional development projects use Ant, Maven, or Gradle instead. Here is an example of Maven.

The IDEs are prepared to use such an external tool, and they can help us in starting them. This way, the build process can run on the developer machine without starting a new shell window. IDEs can also import the settings from the configuration file of these external build tools to recognize the project structure, where source files are, and what to compile to support the error checking while editing.

The building process usually contains the execution of certain checks on the code. A bunch of the Java source file may compile smoothly and the code may still contain a lot of bugs and may be written in bad style, which will make the project becomes unmaintainable in the long run. To avoid such problems, we will use unit tests and static code analysis tools. These do not guarantee error free code but the chances are much better.

IDEs have plugins to run the static code analysis tools as well as unit tests. Being integrated into the IDE has a huge advantage. When there is any problem identified by the analysis tool, or by some unit tests, the IDE provides an error message that also functions like a link on a web page. If you click on the message, usually blue and underlined, exactly like on a web page, the editor opens the problematic file and places the cursor where the issue is.

主站蜘蛛池模板: 沙坪坝区| 泉州市| 成安县| 红安县| 岳阳县| 福鼎市| 岫岩| 阳东县| 三门县| 崇礼县| 临邑县| 萨迦县| 屏东市| 大安市| 衡南县| 贞丰县| 昌邑市| 汶川县| 梅河口市| 宿松县| 霍城县| 寻甸| 嘉黎县| 神池县| 辉南县| 峨边| 镇安县| 康马县| 南靖县| 铁岭县| 龙陵县| 通化市| 泽州县| 新沂市| 淮北市| 木兰县| 平塘县| 巩义市| 准格尔旗| 荃湾区| 信宜市|