Search code examples
javaeclipsekotlinjava-10

eclipse cannot run kotlin (JDK 10)


I tried to start new project in kotlin in eclipse IDE, I install kotlin success, and with the command line I can compile and run kotlin files.

but in eclipse I have an error:

The archive: /Kotlin-test-4/kotlin_bin which is referenced by the
classpath, does not exist.

here is my error error messages

  1. I tried to set new project
  2. to set the file to "kotlin file" and "kotlin class"

eclipse: Oxygen.3a Release (4.7.3a)
java: java 10.0.1 2018-04-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
kotlin plugin version: 0.8.4


Solution

  • you need to run Kotlin with JDK 8. 1. install jdk 8.

    sudo apt-get install openjdk-8-jdk
    
    1. Windows -> Preference -> Java -> Installed JREs click add, and add Standard VM -> write your jdk path -> and for the Default VM arguments write -Xmx512m -ea -Djava.awt.headless=true -> Finish -> Apply and Close
    2. right click on your kotlin project -> Properties -> Java Build Path -> Libaries -> select JRE System Libray and click Remove -> Add Library -> JRE System Libray -> Execution environment -> Select JAVASE-1.8 -> Finish -> Apply and Close