Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.6K
Views
IntelliJ Kotlin - How do I fix "Ensure that you have a dependency on the Kotlin standard library" in a project?

I've been trying to set up a new Kotlin project in IntelliJ IDEA, using the default IntelliJ Build System (not Gradle) and JDK 15. Whenever it creates the default main.kt file, and I try to build and run the main function, which looks like this:

fun main(args: Array<String>) {
    println("Hello World!")
}

the build fails after a short time with the following errors:

Kotlin: Cannot access built-in declaration 'kotlin.Array'. Ensure that you have a dependency on the Kotlin standard library

Kotlin: Cannot access built-in declaration 'kotlin.String'. Ensure that you have a dependency on the Kotlin standard library

and

Kotlin: Unresolved reference: println

I've tried changing the project SDK to the kotlin SDK, to Java 14 and to Java 1.8. I'm not sure exactly how to add the dependency it asks for. Any help is appreciated.

This is what the dependencies window shows within the project: Module Dependencies

Right now the project is using JDK 15, and Kotlin 1.4.10. I've tried updating the plugin, uninstalling and reinstalling, deactivating and reactivating, all to no avail.

The project files can be found here on Google Drive

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Removing the .idea/library file inside the project directory and then selecting "use library from plugin" when prompted to configure Kotlin files by the IDE solved the problem.

over 4 years ago · Santiago Trujillo Report

0

Please provide more information and check what Kotlin version do you have installed:

  1. Tools > Kotlin > Configure Kotlin Plugin Updates: install the latest version of Kotlin

  2. File > Project Structure > Project: what is your Project SDK there? Choose 15 (something line java version "15.0.1"). If you don't have 15 there, click "+" and add the newest version (unless you need an older version).

over 4 years ago · Santiago Trujillo Report

0

I tried all of the above but eventually found out, that in one project, my SDKs were completely broken after the newest Intellij Update. If you go to Project Structure -> Platform Settings -> SDKs, I had an entry for Kotlin with a non existing path for an Intellij Version of last year. This was definitely not there before and it seems to have messed up the kotlin installation. After i deleted that entry and as described above the libraries as well, it worked again.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!