1

Anyone have success using Eclipse for Kotlin development? If so, please advise what Eclipse, JVM and Kotlin plug-in versions you use.

I tried the following combination but only had (very) limited success:

  • Eclipse 2018-12 RC1 (buildId=4.10.0.I20181129-0330)
  • JVM (11.0.1)
  • Kotlin plugin (0.8.11.v20181207-0928)

Eclipse seems to run fine on JVM 11 but Kotlin plug-in gives errors when creating a new Kotlin project:

Errors occurred during the build.
Errors running builder 'KotlinBuilder' on project 'KotTest'.
org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor

Thanks

Eclipse log:

!ENTRY org.eclipse.core.resources 4 75 2018-12-15 15:46:27.368
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.jetbrains.kotlin.ui 4 75 2018-12-15 15:46:27.368
!MESSAGE Errors running builder 'KotlinBuilder' on project 'KotTest'.
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:279)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:703)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:626)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:594)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:574)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:553)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:331)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)

...

Sdf
  • 79
  • 1
  • 6
  • It appears that it can't find the Eclipse JDT editor - do you actually have Eclipse JDT installed as part of your Eclipse? Also note that RC2 is now available - RC2 will probably be the final release of Eclipse SimRel 2018-12. – greg-449 Dec 16 '18 at 08:19
  • I downloaded "Eclipse IDE for Java Developers" so I assume it has JDT included. Going into "Menu > Help > About Eclipse IDE > Installation Details > Configuration", Eclipse shows `org.eclipse.jdt (3.16.0.v20181129-0401) "Eclipse Java Development Tools"` among the installed software. – Sdf Dec 16 '18 at 13:02
  • Possible duplicate of [Unable to Run Kotlin Application in Eclipse](https://stackoverflow.com/questions/40506227/unable-to-run-kotlin-application-in-eclipse) – Alex R Oct 03 '19 at 01:10

2 Answers2

1

I have same issue, it seems Kotlin Eclipse plugin breaks JDT from Eclipse 2018/12 I had to revert back to eclipse 2018/09 to have my workspace working again

  • The same for me. I eventually downgraded to 2018-09 and it worked out of the box. Here's my setup in case if someone's looking for a working configuration: `1. OpenJDK 64-Bit Server VM (build 11.0.1+13-Debian-3, mixed mode, sharing) 2. Eclipse Java EE IDE for Web Developers, Version: 2018-09 (4.9.0), Build id: 20180917-1800 3. Kotlin plugin (0.8.11.v20181207-0928)` – Sdf Dec 18 '18 at 15:50
0

The class that can’t be found exists in {eclipse}/plugins/org.eclipse.jdt.ui_{version}, so this looks like an issue with the Kotlin builder not setting the class path properly. So far, I’ve haven’t found a way to customize the class path used by the builder to work around this.

There is a ticket opened on their bug tracker about this.

Wordman
  • 21
  • 4
  • The JVM will also sometimes throw class not found exceptions when the class actually has been found, but an exception occurs inside its constructor. So, could be this is just an incompatibility with the new version or something. – Wordman Dec 26 '18 at 14:40