I have a project with Java and Kotlin, which I am able to successfully run and build. However, when I open the project in IntelliJ, I see the same error in many of the project files.
The error is "Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies"
See the error in the image attached:
Another example of an error occurs when initializing a Kotlin MultiPlatform Mobile project:
cannot access 'java.lang.Object' which is a supertype of 'org.gradle.api.artifacts.dsl.RepositoryHandler'. Check your module classpath for missing or conflicting dependencies
What is the source of this error? How can I fix it?
If your project is set with a JDK, then probably IDE (Intellij) does not have JDK set but your built application could run just fine with the required JVM.