OS: Windows 10 x64 SDK: JDK 16.0.2 Platforms: IntelliJ IDEA Ultimate 2021.3.2 and Eclipse 2021-12 (4.22.0)
I have a strange problem that has me utterly confused and I'm not really sure how to get about with it. I have a Maven project with JUnit on IntelliJ IDEA 2021.3.2, with a GUI built through IntelliJ's Form Builder tool. The generating GUI setting is switched to "Java Source Code".
The nature of my work (college work) means I need to have an eclipse compatible version of the project for review by someone, which I'm doing through the "File > Export > Export to Eclipse" button. When the project is built, IntelliJ starts throwing errors about it being "Unable to resolve symbol: intellij"
, which is referenced here: IntelliJ inspection gives "Cannot resolve symbol" but still compiles code. I've tried all the answers listed in this question however none of them have been able to get rid of these errors, despite it compiling and running just fine through IntelliJ. The problem arises when I import the project into Eclipse for testing, where it immediately throws a variety of errors which IntelliJ doesn't pick up running on there:
Exception "java.lang.ClassNotFoundException: com/intellij/openapi/editor/RawText"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.openapi.editor.RawText
Exception "java.lang.ClassNotFoundException: com/intellij/openapi/editor/RawText"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.openapi.editor.RawText
Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems:
com.intellij cannot be resolved to a type
com.intellij cannot be resolved to a type
com.intellij cannot be resolved to a type
com.intellij.uiDesigner.core.GridConstraints cannot be resolved to a type
com.intellij.uiDesigner.core.GridConstraints cannot be resolved to a variable
After this appears in Eclipse, it instantly begins appearing in IntelliJ of which I can't seem to find a solution to anywhere, forcing me to reimport the project which'll only result in the same error happening again the next time I need to run it through Eclipse. Does anyone have any idea what's going on here?
EDIT: I just discovered if I delete the target folder it makes after running on eclipse and rebuilding through intelliJ it'll relaunch just fine on there but will reappear on eclipse if I run it again. Sometimes though, it launches and works without issues? This is somehow getting even more confusing