Import Java code


#1

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


#2

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.


#3

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


#4

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.