IntelliJ:仅编译一个Java类会花费很多时间

时间:2019-01-24 16:24:01

标签: java intellij-idea

我正在使用Intelij社区版。 我想使用弹簧加载来替换热代码,如下所述: http://mindthegab.com/2014/08/07/rapid-development-and-hot-reloading-for-your-maven-project-in-eclipse-and-idea-for-free-yes-with-spring-loaded-and-tomcat7-virtualwebapp/

要使用Intellij进行此操作,当我更改Java文件中的代码时,我需要具有最新的.class文件,因此需要重新编译它(Ctrl + Shild + F9)。如果这样做,一切正常。

我不明白的是,在Eclipse能够在不到1秒的时间内生成类文件的情况下,在Java文件(Ctrl + Shift + F9)上进行重新编译会花费大量时间(〜10s)。为何IntelliJ不能像Eclipse一样好?

build.log:

2019-01-24 17:36:27,568 [      0]   INFO - etbrains.jps.cmdline.BuildMain - ==================================================
2019-01-24 17:36:27,569 [      1]   INFO - etbrains.jps.cmdline.BuildMain - Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2018.3.3/lib/jps-launcher.jar;D:/projets/products/java/v1.8.0_73-x64/lib/tools.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2018.3.3/lib/optimizedFileManager.jar
2019-01-24 17:36:27,926 [    358]   INFO - etbrains.jps.cmdline.BuildMain - Connection to IDE established in 319 ms
2019-01-24 17:36:28,122 [    554]   INFO - jps.cmdline.JpsModelLoaderImpl - Loading model: project path = XXX
2019-01-24 17:36:28,495 [    927]   INFO - serialization.JpsProjectLoader - External project config dir is used: XXX
2019-01-24 17:36:28,519 [    951]   INFO - serialization.JpsProjectLoader - External project config dir is used for modules: XXX
2019-01-24 17:36:29,299 [   1731]   INFO - jps.cmdline.JpsModelLoaderImpl - Model loaded in 1177 ms
2019-01-24 17:36:29,300 [   1732]   INFO - jps.cmdline.JpsModelLoaderImpl - Project has 144 modules, 529 libraries
2019-01-24 17:36:29,732 [   2164]   INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=602
2019-01-24 17:36:29,897 [   2329]   INFO - .incremental.IncProjectBuilder - Building project; isRebuild:false; isMake:false parallel compilation:false
2019-01-24 17:36:29,899 [   2331]   INFO - kotlin.jps.build.KotlinBuilder - is Kotlin incremental compilation enabled for JVM: true
2019-01-24 17:36:29,899 [   2331]   INFO - kotlin.jps.build.KotlinBuilder - is Kotlin incremental compilation enabled for JS: false
2019-01-24 17:36:29,907 [   2339]   INFO - kotlin.jps.build.KotlinBuilder - is Kotlin compiler daemon enabled: true
2019-01-24 17:36:29,907 [   2339]   INFO - kotlin.jps.build.KotlinBuilder - Label in local history: build started a31f9eb8
2019-01-24 17:36:30,495 [   2927]   INFO - .incremental.IncProjectBuilder - Cleaned output directories in 98 ms
2019-01-24 17:36:34,532 [   6964]   INFO - kotlin.jps.build.KotlinBuilder - KotlinTargetsIndex created in 3368 ms
2019-01-24 17:36:34,555 [   6987]   INFO - kotlin.jps.build.KotlinBuilder - Total Kotlin global compile context initialization time: 3394 ms
2019-01-24 17:36:34,630 [   7062]   INFO - s.incremental.java.JavaBuilder - Compiling 1 java files; module: <MODULE_NAME>
2019-01-24 17:36:36,784 [   9216]   INFO - brains.jps.incremental.Builder - Dependency analysis found 0 affected files
2019-01-24 17:36:36,962 [   9394]   INFO - rains.jps.cmdline.BuildSession - Build duration: Builder 'Maven Resources Compiler' took 144 ms; 0 sources processed
2019-01-24 17:36:36,962 [   9394]   INFO - rains.jps.cmdline.BuildSession - Build duration: Builder 'Java' took 2 s 129 ms; 1 sources processed (2129 ms per file)
2019-01-24 17:36:36,964 [   9396]   INFO - s.incremental.java.JavaBuilder - javac 1.8.0_73 was used to compile [<MODULE_NAME>]
2019-01-24 17:36:38,487 [      0]   INFO - etbrains.jps.cmdline.BuildMain - ==================================================
2019-01-24 17:36:38,488 [      1]   INFO - etbrains.jps.cmdline.BuildMain - Build process started. Classpath: C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2018.3.3/lib/jps-launcher.jar;D:/projets/products/java/v1.8.0_73-x64/lib/tools.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2018.3.3/lib/optimizedFileManager.jar
2019-01-24 17:36:38,911 [    424]   INFO - etbrains.jps.cmdline.BuildMain - Connection to IDE established in 380 ms
2019-01-24 17:36:38,953 [    466]   INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational
2019-01-24 17:36:38,992 [    505]   INFO - jps.cmdline.JpsModelLoaderImpl - Loading model: project path = XXX, global options path = XXX
2019-01-24 17:36:39,404 [    917]   INFO - serialization.JpsProjectLoader - External project config dir is used: XXX
2019-01-24 17:36:39,433 [    946]   INFO - serialization.JpsProjectLoader - External project config dir is used for modules: XXX
2019-01-24 17:36:40,132 [   1645]   INFO - jps.cmdline.JpsModelLoaderImpl - Model loaded in 1140 ms
2019-01-24 17:36:40,132 [   1645]   INFO - jps.cmdline.JpsModelLoaderImpl - Project has 144 modules, 529 libraries
2019-01-24 17:36:40,669 [   2182]   INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=602
2019-01-24 17:36:44,092 [   5605]   INFO - etbrains.jps.cmdline.BuildMain - Pre-loaded process ready in 5607 ms

0 个答案:

没有答案