Class 'myClassName' already exists in package 'myPackageName'

I suddently started facing strange issue while working on my grails application using IntelliJ. I have different domain classes and some other classes under src/groovy. When I move to some class to make some changes, I get error that this class already exists in package while I don't have. I tried to re-named it using re-factor but after that too I get the same error.
can anybody guide me that what's wrong there ? Or I did something wrong ?
Thanks in Advance :-)


A package is a folder that holds class files. They can be used to organize your classes, interfaces, enums, etc. as opposed to just having one massive folder with everything in it. wakehealth login

// If you have some Groovy functionality that you would like others to use
// you either make the source code available or compile it into class files
// and package those up in a jar file. Some subset of your class files will
// define the OO interface to your functionality, e.g. public methods,
// interfaces, etc. Depending on the circumstances, various conventions are
// used to indicate this functionality including Manifest files, javadocs,
// deployment descriptors, project metadata and dependency management files.
// See 12.18 for an example.

As i know sometimes IntelliJ may have stale or incorrect information about your project structure. Try refreshing the project to see if it resolves the issue. Go to File -> Invalidate Caches / Restart and choose the appropriate option to refresh your project or perform a clean build of your Grails application to ensure that any potential caching issues or inconsistencies are resolved. You can do this by running the grails clean command from the command line, or using the Grails-specific options in your IntelliJ Run/Debug configuration.


Please sign in to leave a comment.