Question: When compiling a project in idea IDE, error occurs:
 Error:osgi: [Test] The default package '.' is not permitted by the Import-Package syntax. 
 This can be caused by compile errors in Eclipse because Eclipse creates 
 valid class files regardless of compile errors.
 The following package(s) import from the default package null

But when using Eclipse ide, it works.
I've googled times, only found [this](https://stackoverflow.com/questions/33395100/the-default-package-is-not-permitted-by-the-import-package-syntax) post , but it's not my case.
I de-compiled the produced class by OSGI, there's no class has syntax like `import .`
Any idea for this problem?

[![enter image description here](https://i.stack.imgur.com/wZuQx.png)](https://i.stack.imgur.com/wZuQx.png)

Answer: 
Can you change package of your classes? That way eclipse will create new classes after compilation. Having '.' package is not good practice anyway. 

Also, prefer different workspace for eclipse and intellij. Having 3 folders is good practice, one for source, one for eclipse workspace, one for intelliJ workspace. Each IDE creates their own files
I got this error due to a Groovy script file that had import statements, but no package name at the start of the file. I added a package name to my Groovy script, **ran a clean to erase my target directory**, and then the problem went away.

See answer by Hemant [in this similar issue](https://stackoverflow.com/questions/33395100/the-default-package-is-not-permitted-by-the-import-package-syntax)