Paul Krill
Editor at Large

JetBrains introduces Java to Kotlin converter for Visual Studio Code

news
Feb 20, 20262 mins

Extension that converts individual Java files to Kotlin code aims to ease the transition to Kotlin for Java developers.

A computer screen shows the Kotlin logo against a backdrop of code.
Credit: Trismegist san / Shutterstock

In a bid to ease the adoption of its Kotlin programming language by Java developers, JetBrains has introduced a Java to Kotlin converter extension for Microsoft’s Visual Studio Code editor. Long established as an alternative to Java, Kotlin is widely used in Java spaces such as Android mobile application development.

Introduced February 19, the Java to Kotlin converter extension is downloadable from the Visual Studio Marketplace. Developers using it can convert individual Java files into Kotlin code with a context menu action, reducing the manual effort of migrating legacy codebases or switching languages in the middle of a project. The extension uses the same underlying engine used in JetBrains IDEs and draws on large language models (LLMs) to provide idiomatic conversion suggestions, providing one-click, review-before-you-commit Java to Kotlin migration inside VS Code, according to JetBrains.

Developers can expect a reliable conversion that respects Kotlin idioms and syntax requirements, Alina Dolgikh, Kotlin product manager at JetBrains, said. The extension was developed out of recognition that many developers use VS Code for a variety of projects and tasks, even if JetBrains’s IntelliJ Idea IDE remains the premier IDE for Kotlin, she said.

The Java to Kotlin converter extension gives the following settings to VS Code:

  • j2k.provider: The LLM backend to use for the Java to Kotlin conversion. Default: GitHub Copilot.
  • j2k.model: The model tag to use with the selected provider. Default: codellama:instruct.
  • j2k.ollama.baseUrl: The base URL of the target instance, when the provider selected is Ollama.
  • j2k.openRouter.baseUrl: The base URL of the target instance, when the provider selected is OpenRouter.
  • j2k.apiKey: The API key to use with the selected provider (stored in VS Code Secrets).
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author