Package doesn't exist error in intelliJ

后端 未结 25 1175
心在旅途
心在旅途 2020-11-28 20:07

I\'m trying to use the barbecue barcode printing library. I have successfully added the library to IntelliJ through project structure add library. Then I imported the packa

相关标签:
25条回答
  • 2020-11-28 20:43

    None of the 13 existing answers worked for me. However, I could resolve the issue by first removing all modules:

    1. open File > Project Structure...,
    2. go to Modules tab,
    3. select all modules and press the remove button,

    then removing all remaining Maven modules from Maven tool window:

    1. select all modules,
    2. right click on them,
    3. press Remove projects,

    and then adding them again in Project tool window:

    1. right click on root pom.xml,
    2. press Add as Maven project,

    now unignoring any ignored modules from Maven tool window:

    1. select all ignored (grey) Maven modules,
    2. right click on them,
    3. press Unignore,

    and finally rebuilding using Build > Rebuild project. This assumes that a mvn clean install already happened.

    0 讨论(0)
  • 2020-11-28 20:47

    I had the same problem and it was fixed for me by changing the "Maven home directory" in Settings from "Bundled" to my locally installed maven. Perhaps this triggered some kind of refresh somewhere since I had not changed this setting for months without any issue.

    0 讨论(0)
  • 2020-11-28 20:48

    I tried all appreciated answers and none of them solve my problem!

    According to Intellij community, there is a bug with Maven builds in 2020.1 and 2020.1.1 versions: https://youtrack.jetbrains.com/issue/IDEA-237320?_ga=2.235486722.203129946.1591253608-322129264.1584010541

    Please try to run on 2019.3.4 version (Its worked for me from the first time)

    You can download from here

    https://www.jetbrains.com/idea/download/previous.html?_ga=2.190043688.203129946.1591253608-322129264.1584010541

    0 讨论(0)
  • 2020-11-28 20:48

    Here is a solution worked for me: Disable the "Use --release option for cross-compilation like the following in intellij idea: got Settings -> Build,Execution,Deployment -> Compiler -> Java Compiler and disable:

    Use '--release' option for cross compilation(java 9 and later)

    0 讨论(0)
  • 2020-11-28 20:49

    I tried to "Maven > Reimport" but the only thing that actually fixed it was to close the project, delete the .idea directory, and reopen the project.

    0 讨论(0)
  • 2020-11-28 20:50

    Just reimport didn't work. Following worked for me.

    File -> Invalidate Caches /Restart

    Then

    Build -> Rebuild Project

    That will reimport maven project.

    0 讨论(0)
提交回复
热议问题