0

I am writing Junits for the Java files in my projects. (call it A.java) IntelliJ is actually linking the A.class when I am navigating to the code. Because of this, As and when I change source code in A.java, i have to build the code so that it reflects in A.class, and then update the tests. Is there a way to link IntelliJ directly to source path.

I already tried but issue was not solved: IntelliJ shows decompiled .class file instead of source code

IntelliJ Version: 2021.IntelliJ IDEA 2021.1.2 (Ultimate Edition)

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
voldegaur
  • 194
  • 2
  • 12
  • 1
    Make sure the tests and the main sources reside in the correct project roots, see https://www.jetbrains.com/help/idea/configuring-content-roots.html. Use source and test source roots. Do not add output paths or jars containing the same files as you have in sources to the libraries. If the issue persists, please share the [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – CrazyCoder Jul 20 '21 at 20:53
  • Thanks a ton. Somehow my build was adding all the generated output paths in the project's content root. Deleting unwanted paths from the content root resolved the issue. But I am still not sure, how is the generated source getting added as content root multiple times after every build – voldegaur Jul 23 '21 at 08:41

0 Answers0