天天看點

IDEA常見使用問題整理

概述

宇宙第一神器。

Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:1099

不要使用IDEA内置的JDK即可解決問題。

Command line is too long

項目或者單元測試啟動失敗,彈窗報錯, Error running ‘aaaaa’: Command line is too long. Shorten command line for octopus-be or also for Spring Boot default configuration?

解決方案:

  1. 修改項目下​

    ​.idea\workspace.xml​

    ​​,找到标簽 ​

    ​<component name="PropertiesComponent">​

    ​​,在标簽裡加一行 ​

    ​<property name="dynamic.classpath" value="true" />​

  2. 如果是使用IDEA 2020.3.4(更早版本暫不知),上述解決方案無效,使用下面的紅框内的任一一種方式,可以解決:

Cannot download sources Sources not found for

想要檢視源碼檔案時報錯,嘗試執行如下指令:​

​mvn dependency:sources -DincludeArtifactIds=guava​

java: 找不到符号

  1. 如果是使用lombok,則嘗試更新一下插件版本,并確定如下選項處于checked狀态:
  2. 考慮使用右側Maven面闆功能,點選編譯失敗檔案所在的module,打開lifecycle,輕按兩下clean,即在編譯失敗子產品目錄下面執行指令:​

    ​mvn clean​

  3. 該檔案或方法确實存在編譯問題,一般是送出不完整,或合并分支并解決沖突解決得有問題導緻,解決編譯問題即可;
  4. IDEA緩存index損壞,重新開機IDEA,甚至清除緩存然後重新開機,不是很推薦,重建索引、緩存非常耗時間:

Can’t download sh shfmt formatter. Please install it manually