2

I would like to import java.lang.module to use https://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleDescriptor.Version.html

How can I do this in a gradle .kts Kotlin script?

I tried

import java.lang.module

which did not work.

0

2 Answers 2

3

You can't import packages in Java. You need to import a specific class:

import java.lang.module.ModuleDescriptor

Or import all classes from a package:

import java.lang.module.*

It is not really related to Gradle, it is specific to Java/Kotlin.

Sign up to request clarification or add additional context in comments.

Comments

0

Upgrade your Project JDK to JDK 11. Import the Version class directly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.