Kotlin / kotlinx.coroutines

Library support for Kotlin coroutines
Apache License 2.0
13.01k stars 1.85k forks source link

JDK_16 error #1684

Closed IgorGanapolsky closed 2 years ago

IgorGanapolsky commented 4 years ago

Hello, I am not able to run any code nor unit tests in this repo. IntelliJ constantly gives this error:

Build file '/Users/igorganapolsky/workspace/git/kotiln/kotlinx-coroutines-core/build.gradle' line: 61 Execution failed for task ':kotlinx-coroutines-core:checkJdk16'. JDK_16 environment variable is not defined. Can't build against JDK 1.6 runtime and run JDK 1.6 compatibility tests. Please ensure JDK 1.6 is installed and that JDK_16 points to it.

qwwdfsad commented 4 years ago

Have you tried to define JDK_16 environment variable as [documentation] (https://github.com/Kotlin/kotlinx.coroutines#building) and error message suggest?

IgorGanapolsky commented 4 years ago

Why is JDK_16 required for coroutines?

qwwdfsad commented 4 years ago

Because kotlinx.coroutines is compatible with Java 6 (Android 14 I suppose) and we ensure that by running tests with JDK 6

imanushin commented 4 years ago

@IgorGanapolsky , see also #1589 for coroutines + JDK6.

IgorGanapolsky commented 4 years ago

So it sounds like JDK6 requirement will be dropped in the near future :)

MilkBiscuit commented 3 years ago

I still can see this issue.

Can not run 'exampleBasic09' until I comment below code in build.gradle

        if (!System.env.JDK_16) {
            throw new GradleException("JDK_16 environment variable is not defined. " +
                    "Can't build against JDK 1.6 runtime and run JDK 1.6 compatibility tests. " +
                    "Please ensure JDK 1.6 is installed and that JDK_16 points to it.")
        }

I don't understand why you are still keeping this code.

elizarov commented 3 years ago

We have to ensure that we don't accidentally build it against a later version of JDK 1.6 and accidentally use classes not present in JDK 1.6. As spelled out in contribution guide, you can simply set JDK_16 to JAVA_HOME.

mcpiroman commented 3 years ago

I've heard kotlin 1.5 no longer supports java 1.6 (and 1.7). Should it be dropped here, too?

qwwdfsad commented 3 years ago

Thanks, that's worth taking care of to simplify the life of external contributors. It's a big bigger than just removing it from Gradle, because it requires some changes in our TC infrastructure as well

qwwdfsad commented 2 years ago

Fixed in current develop