1

When I tried to Run a .java file during the build I got the following Error

Module 'JAVA-Workspace' production: java.lang.ClassCastException: class org.jetbrains.jps.builders.java.dependencyView.TypeRepr$PrimitiveType cannot be cast to class org.jetbrains.jps.builders.java.dependencyView.TypeRepr$ClassType (org.jetbrains.jps.builders.java.dependencyView.TypeRepr$PrimitiveType and org.jetbrains.jps.builders.java.dependencyView.TypeRepr$ClassType are in unnamed module of loader java.net.URLClassLoader @490d6c15)

'JAVA-Workspace' is my project directory. It was fine a few minutes ago I was debugging the same file. I did not install any new plugins at the time. Java 11 | Intellj Version

I tried :

  • Remove caches and indexes by Invalidate and Restart < Invalidate Caches < File.
  • Delete .idea in root directory of the project.

Thank You

abhinit21
  • 88
  • 2
  • 10
  • Check if this helps: https://stackoverflow.com/questions/64336525/how-do-i-fix-an-error-in-intellij-that-prevents-me-from-running-my-projects – pringi Feb 21 '22 at 09:27
  • @pringi I saw that thread. Noting working for him too. He replied wait for the next update . . . – abhinit21 Feb 21 '22 at 09:31
  • 1
    What version of Intellij, what version of java? Try also to run from command line and check the errors you obtain. I think the problem will be related with Java modules. See this: https://stackoverflow.com/questions/67782975/how-to-fix-the-module-java-base-does-not-opens-java-io-to-unnamed-module – pringi Feb 21 '22 at 09:41
  • Have you tried creating a new project with just your source code to see if that builds? Or reinstalling IntelliJ? – Siddiqui Feb 21 '22 at 10:49
  • not i have not tried to re-install yet . . . I want to understand the error too. I will do if nothing works. – abhinit21 Feb 21 '22 at 18:33

0 Answers0