# Pre release version problem with kotlin in Intellij

**URL:** <https://discuss.kotlinlang.org/t/pre-release-version-problem-with-kotlin-in-intellij/2311>\
**Category:** Uncategorized\
**Created:** [February 23, 2017, 10:44pm UTC](https://discuss.kotlinlang.org/t/pre-release-version-problem-with-kotlin-in-intellij/2311 "2017-02-23T22:44:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerem44](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jerem44](https://discuss.kotlinlang.org/u/jerem44)\
**Post date:** [February 23, 2017, 10:44pm UTC](https://discuss.kotlinlang.org/t/pre-release-version-problem-with-kotlin-in-intellij/2311/1 "2017-02-23T22:44:14Z")

</div>

Hello,

I try to use kotlin with intellij with the last version of the kotlin intellij plugin

This is for being able to write gradle script using kotlin.

But that not working, I have this error message when i try to use the kotlin API

"“Class ‘’{0}‘’ is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler”

I use intellij 2016.3.4 and the kotlin toolkit plugin 1.1.0-rc-91-IJ2016.3-1 which is apparently the most recent I can have.

I use this exenple : [kotlin-dsl-samples/samples/hello-kotlin at master · gradle/kotlin-dsl-samples · GitHub](https://github.com/gradle/gradle-script-kotlin/tree/master/samples/hello-kotlin)

I have this error in the build.gradle.kts file but also in the src/main/kotlin/samples/helloworld.kt.

Does anyone has an idea ?

thanks

---

<div class="post-metadata">

**Author:** ![yole](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yole/32/1425_2.png) [@yole](https://discuss.kotlinlang.org/u/yole)\
**Post date:** [February 24, 2017, 7:17am UTC](https://discuss.kotlinlang.org/t/pre-release-version-problem-with-kotlin-in-intellij/2311/2 "2017-02-24T07:17:18Z")

</div>

The Gradle folks need to publish a new release of Gradle Script Kotlin built with Kotlin 1.1 RC. Once they do that, the problem will be resolved.

---

<div class="post-metadata">

**Author:** ![jerem44](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jerem44](https://discuss.kotlinlang.org/u/jerem44)\
**Post date:** [February 24, 2017, 12:44pm UTC](https://discuss.kotlinlang.org/t/pre-release-version-problem-with-kotlin-in-intellij/2311/3 "2017-02-24T12:44:33Z")

</div>

So, let’s wait ^^

---

<div class="post-metadata">

**Author:** ![Hubbitus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/hubbitus/32/2720_2.png) [@Hubbitus](https://discuss.kotlinlang.org/u/Hubbitus)\
**Post date:** [June 8, 2017, 7:46pm UTC](https://discuss.kotlinlang.org/t/pre-release-version-problem-with-kotlin-in-intellij/2311/4 "2017-06-08T19:46:56Z")

</div>

Does it happened? How I could update in my existing project?

How I could add `wrapper` task as it was in `groovy` version of `gradle.build` script?

---

<div class="post-metadata">

**Author:** ![Hubbitus](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/hubbitus/32/2720_2.png) [@Hubbitus](https://discuss.kotlinlang.org/u/Hubbitus)\
**Post date:** [June 9, 2017, 7:28am UTC](https://discuss.kotlinlang.org/t/pre-release-version-problem-with-kotlin-in-intellij/2311/5 "2017-06-09T07:28:49Z")

</div>

Eeh, it seems it is IntelliJ Idea replace  
`distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-4.0-20170523130707+0000-bin.zip`  
to incorrect `distributionUrl=https\://repo.gradle.org/gradle/dist-snapshots/gradle-script-kotlin-4.0-20170523130707+0000-all.zip` on project import or refresh.

It works with console `./gradlew`.

How it may be fixed?

> <https://github.com/gradle/kotlin-dsl-samples/issues/391#issuecomment-307316912>
>
> \`hello-kotlin\` sample:
> 
> \`\`\`
> ./gradlew
> \`\`\`
> \`\`\`
> Downloading https://services….gradle.org/distributions-snapshots/gradle-4.0-20170523130707+0000-bin.zip
> 
> Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle.org/distributions-snapshots/gradle-4.0-20170523130707+0000-bin.zip
> at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)
> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
> at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
> at org.gradle.wrapper.Download.downloadInternal(Download.java:66)
> at org.gradle.wrapper.Download.download(Download.java:51)
> at org.gradle.wrapper.Install$1.call(Install.java:62)
> at org.gradle.wrapper.Install$1.call(Install.java:48)
> at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
> at org.gradle.wrapper.Install.createDist(Install.java:48)
> at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
> at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
> \`\`\`
