Import Java code

hello, I’m trying to use Java code in my programs but I get this error:
error: unresolved reference: util
import java.util.*

You sure you set up your project correctly? You can only use java libraries if you use kotlin to target the jvm. If you use Kotlin JS or K/N you can’t.

Btw. Please don’t post multiple times with the same issue. This will just result in unnecessary spam.

Sorry for posting multiple times. When I use gradle for build it works fine but when I try to compile using cmd it fail.
Sorry for my bad english.