Windows 7 64-bit Eclipse Oxygen convert Java to Kotlin fails

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(
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(

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:

Kotlin plugin version is 0.8.4

I installed IntelliJ, and Convert Java to Kotlin works over there.


I think you should file a new issue here? Maybe check that it does not exist first, but I could not find a related issue.

Thank you, I appreciate your suggestion. I will follow-up with a bug report as you suggest. From my experience with other software, I’m assuming the proper procedure is to start here to see if the community has any quick remedies. If not, then submit a bug report.

For problems with the language you are right, but this looks like a bug to me. As long as you have the latest version of the plugin installed I can’t see why this should not work as intended, especially if the feature is working in intellij idea.

Found a similar issue, so I added a comment to that one:

Thanks for your help.