Package doesn't exist error in intelliJ

后端 未结 25 1179
心在旅途
心在旅途 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:59

    Maven reimport, rebuild and invalidate caches did not work. I solved it by opening a terminal and executing maven clean install in the root folder project. (IntelliJ was opened and I was able to see the IDE updating and triggering reindexation while maven was doing his job)

    0 讨论(0)
  • 2020-11-28 21:00

    I did re-import all maven projects. This worked for me.

    0 讨论(0)
  • 2020-11-28 21:01

    Tried all the above approaches, didn't work. Finally running maven clean install solved it!

    0 讨论(0)
  • 2020-11-28 21:04

    As someone who only occasionally needs to do Java work, this was very annoying. Inevitably, packages would have been added since the last time I ran our server inside IntelliJ and it would fail to build. I found what seems to be an easier solution: just don't build within IntelliJ. Build from the command line via Maven, then make sure that the run configuration does not list Build as a "Before launch" task.

    0 讨论(0)
  • 2020-11-28 21:05

    If you do not want to destroy .idea, you can try :

    • open Project Structure > Modules
    • unmark the java folder as a source folder
    • apply / rebuild
    • then mark it again as a source folder
    • rebuild
    0 讨论(0)
  • 2020-11-28 21:07

    If you are trying the suggested ways and still no chance, be sure about your order:

    1. Delete your .idea/
    2. Invalidate and Restart Cache afterwards
    3. Import maven projects from your maven tool

    If you did not invalidate and restart cache just after deleting your .idea/, Intellij keeps generating it and that was keeping error in my case.

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