For Ktor 1.0.0 server, java version 1.8.0_181 (running server on localhost, Ubuntu 18.04.1 LTS)
Facing the following issue:
Exception in thread "main" java.lang.IllegalArgumentException: Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf
at io.ktor.server.engine.CommandLineKt$commandLineEnvironment$environment$1.invoke(CommandLine.kt:121)
at io.ktor.server.engine.CommandLineKt$commandLineEnvironment$environment$1.invoke(CommandLine.kt)
at io.ktor.server.engine.ApplicationEngineEnvironmentBuilder.build(ApplicationEngineEnvironment.kt:95)
at io.ktor.server.engine.ApplicationEngineEnvironmentKt.applicationEngineEnvironment(ApplicationEngineEnvironment.kt:40)
at io.ktor.server.engine.CommandLineKt.commandLineEnvironment(CommandLine.kt:50)
at io.ktor.server.netty.EngineMain.main(EngineMain.kt:16)
at com.gurpreetsk.ApplicationKt.main(Application.kt:36)
However, the application.conf file contains the following:
ktor {
deployment {
port = 8080
port = ${?PORT}
}
application {
modules = [ com.gurpreetsk.ApplicationKt.module ]
}
}
Most likely application.conf is not in the classpath
How do I add it to the classpath? It is not working of a new ktor project either.
Is it placed in a resources source root?
Yes. Attaching project structure screenshot along-with:

That's quite strange that you have orange test and out directories. For sure something is misconfigured.
application.conf should be in out directory, like this:

I've just tried to create a project using ktor plugin and it runs just fine in IDEA and via gradle as well. Same for website https://start.ktor.io
Let me try and update here in some time if I solve this.
Have you resolved the issue?
No. I still can't figure out what's wrong. However, it seems like a machine issue (wrong PATH or something) as the project runs fine on my other machine.
Hello.
I just update IDEA and ktor plugin and get same issue.
It's my old good working small feature testing project
ktor 1.0.0, Win7 64
I also encountered the same problem. totally do not understand.
There was the same problem after the update of the IDE, it helped "Sync Project with Gradle Files"
Most helpful comment
There was the same problem after the update of the IDE, it helped "Sync Project with Gradle Files"