Intellij Idea not building when I press Run

Viewed 8919

I have a simple hello world project in Kotlin, running in Intellij Idea. I can build and run it just fine, but if I make changes, save and press the green run button (or Shift+F10), Intellij runs the old version of the file, before I made the changes. I can fix this by first Building the project (Ctrl+F9), then running it (Shift+F10). Why is this? Must I always build first, then run? Why doesn't Run build the project for me?

Here is my code, though I'm sure that's not the problem:

fun main(args: Array<String>) {
    println("hello world")
}
2 Answers

IntelliJ uses defined libraries as your dependencies to build and run the application. So it looks into: Project Structure -> Module -> Dependencies

If IntelliJ cannot run your project, some dependencies are missing there for sure!

For you to solve the issue, add the missing jar file or the folder containing the jar files there and the problem will be solved immediately!

Related