can i tell the kotlin compiler that it should not ...
# announcements
c
can i tell the kotlin compiler that it should not allow to use jdk methods that are not in jdk 1.8? (that have a
@since 9
annotation for example). or do i have to use 1.8 to build?
h
You can point the compiler to the JDK classes to use with the
-jdk-home <path>
parameter. Just using 1.8 is probably the easier way.
c
good idea, thanks!
btw one reason why i want this is that some jdk 9+ methods are similar to kotlin methods (
InputStream.readAllBytes
vs
InputStream.readBytes
)
n
you can set
Copy code
java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
that should disallow 9+
if i misunderstood that then i might be missing the point of that configuration though
c
i think thats for syntax and not for jdk