Running Eclipse Oxygen for JavaEE Developers on Windows 7 64-bit, learning Kotlin by converting existing Java code. In Package Explorer, if I right click on a Java file (containing an interface definition) and select “Convert Java to Kotlin”, nothing appears to happen. However, if I open Windows-Show View-Others-General-Error Log, I see that a message has been created in the error log. Opening that reveals a large stack trace; here’s the top part of it:
org.eclipse.e4.core.di.InjectionException: kotlin.UninitializedPropertyAccessException: lateinit property index has not been initialized
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
Further down is a Caused by section that may be more relevant:
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property index has not been initialized
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:74)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.access$findVirtualFileForTopLevelClass(KotlinCliJavaFileManagerImpl.kt:46)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:68)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$findPsiClass$1.invoke(KotlinCliJavaFileManagerImpl.kt:46)
at org.jetbrains.kotlin.util.PerformanceCounter.time(PerformanceCounter.kt:91)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClass(KotlinCliJavaFileManagerImpl.kt:67)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:129)
Underneath the stack trace is Session Data. Here’s the interesting info:
eclipse.buildId=4.7.3.M20180330-0640
java.version=1.8.0_74
Kotlin plugin version is 0.8.4
I installed IntelliJ, and Convert Java to Kotlin works over there.
Thanks.