Home > Software design >  Preventing duplicate class error in Java/IntelliJ
Preventing duplicate class error in Java/IntelliJ

Time:03-09

I'm writing an interpreter (w. enter image description here

So, subsequently, I'll duplicate into jlox[Y] dir, where Y = chapter to preserve.

The problem with copying like this is that IntelliJ sees all the classes as duplicates, preventing any code from building. Is there a way/setting to avoid a duplicate class error with the added constraint of being able to maintain duplicates of the code base in the same folder?

enter image description here

CodePudding user response:

I tried a few things and this worked: making every dir under root a module.

You'll notice in first image (above) that jlox is not a module, but jlox[7] is. So the fix was to make jlox a module as well.

  • Related