Compiling jdk8 packages with kotlinc -- packages cannot be imported error | java.time


#1

I am trying to compile a simple kotlin program (provided below; which uses the jdk8 package ‘java.time’) using the kotlin command line compiler - kotlinc.
I get the package cannot be imported error.

Program.kt

import java.time
fun main(args: Array<String>) {}

Command Line
kotlinc Program.kt -include-runtime -d p.jar

Error:
error: packages cannot be imported
import java.time

JAVA_HOME
"C:\Program Files\Java\jdk1.8.0_131"


#2

The error says:

cannot import packages

Perhaps you should try:

import java.time.*

#3

It works, cannot believe I made such a mistake.
Thanks.