Image by Freepik

After more than a year of work I’m pleased to announce the first release of my Java to Typescript converter tool. It is open source and has been released under the MIT license. With this permissive license the tool is usable by essentially everybody, but keep in mind that code you translate with it still pertains to the original license. For example, if you translate Java source code (which uses the GPL) the resulting Typescript code also must be released under GPL (as it is considered derived work).

The converter alone would not be of much help if there was no runtime library with the required classes. For this reason another project was started, called the JRE Emulation (or short jree), which is a partial implementation of the java.base module in TypeScript. For now it contains mostly JRE types that are required to power yet another (ongoing) project: a4tstool, a port of the famous ANTLR4 parser generator to TypeScript. This task was what triggered the creation of the java2typescript tool.

Both java2typescript and jree are available as node packages and can so easily be used in your Node.js or web projects. For the browser you will need a bundler like rollup or webpack to shim out the parts that require Node.js (usually all file related classes). To help you to get started with the converter there is example repository, with a number of projects from simple to advanced usage.

Leave a Reply