TeaVM

What TeaVM is
TeaVM is a free, web-focused compiler that converts compiled Java bytecode into JavaScript and WebAssembly for browser applications. It works with class or JAR files produced by Java, Kotlin and Scala compilers, making it suitable for developers building a web front end or reusing selected backend code in the browser. Maven archetypes and a Gradle plugin are documented for project setup, and generated applications can be deployed as WAR files or opened from an unzipped directory. TeaVM provides JavaScript interop APIs, including browser API wrappers, and documents optimizations such as dead-code elimination, devirtualization and method renaming. It can transform methods into continuation-passing style to emulate logical threads as green threads. Source maps are produced, and an IDEA plugin supports IDE debugging. Compatibility is limited: reflection, resources, class loaders and JNI are restricted, while only part of the Java class library is implemented. WebAssembly projects must be served over HTTP because browsers do not load wasm files directly from the local file system. The project is distributed under Apache License 2.0.
Who it suits
TeaVM fits Java, Kotlin and Scala developers who want browser front ends or to reuse some backend code in web applications. It is aimed at teams comfortable adapting code to its supported API subset.
What it does well
- Compiles Java, Kotlin and Scala output
- Produces JavaScript and WebAssembly
- Maven and Gradle project integrations
- JavaScript and browser API interop
- Source maps support debugging
What to know first
- Only a limited Java library subset is implemented
- Reflection, resources, class loaders and JNI are restricted
- WebAssembly requires HTTP serving
- Code may need rewriting for compatibility
Verdict
TeaVM offers a free route from JVM-compiled code to browser targets, with build integrations, optimization and debugging support. Its constrained APIs and partial Java library mean projects must be checked and adapted before deployment.
Facts from TeaVM's own pages
- Browser deployment
- The guide says WebAssembly projects must be served over HTTP because browsers do not load wasm files from the local file system. · teavm.org, 8 Oct 2026
- Browser interop
- TeaVM provides JavaScript interoperability APIs, including wrappers for interacting with browser APIs. · teavm.org, 8 Oct 2026
- Build integrations
- The getting-started guide documents Maven archetypes and a Gradle plugin, with generated web apps deployable as WAR files or opened from an unzipped directory. · teavm.org, 8 Oct 2026
- Build tools
- The getting started guide shows Maven archetypes and a Gradle plugin for creating TeaVM projects. · teavm.org, 8 Oct 2026
- Compatibility limits
- TeaVM restricts APIs including reflection, resources, class loaders, and JNI, and says code may need to be rewritten to fit its constraints. · teavm.org, 8 Oct 2026
- Constraints
- TeaVM restricts Java APIs including reflection, resources, class loaders, and JNI, and its Java class library implementation covers only a limited subset. · teavm.org, 8 Oct 2026
- Contact
- The official site lists [email protected] as a contact email. · teavm.org, 8 Oct 2026
- Debugging
- TeaVM produces source maps, and its IDEA plugin supports debugging code from the IDE. · teavm.org, 8 Oct 2026
- Intended users
- The project describes TeaVM as a fit for Java, Kotlin, or Scala developers building web front ends within their existing development ecosystem. · teavm.org, 8 Oct 2026
- Interop
- TeaVM provides a JavaScript interop API, and the Gradle guide shows an optional dependency with browser API wrappers. · teavm.org, 8 Oct 2026
- Java library coverage
- TeaVM implements only a limited subset of the Java class library, so use of unsupported APIs can cause compilation errors. · teavm.org, 8 Oct 2026
- Language inputs
- It works from compiled class or JAR files and can compile code produced by Java, Kotlin, and Scala compilers. · teavm.org, 8 Oct 2026
- Language support
- It can compile bytecode produced by Java, Kotlin, and Scala compilers. · teavm.org, 8 Oct 2026
- License
- The project repository states that TeaVM is distributed under the Apache License 2.0. · github.com, 8 Oct 2026
- Optimization
- TeaVM documents dead code elimination, devirtualization, and method renaming among its optimizer capabilities. · teavm.org, 8 Oct 2026
- Preview builds
- Development builds are available from TeaVM's repository, with instructions for Maven, Gradle, and the IDEA plugin. · teavm.org, 8 Oct 2026
- Support
- The project lists [email protected] for contact and says users can report issues on its project issue tracker. · github.com, 8 Oct 2026
- Threads
- TeaVM can transform methods to continuation-passing style to emulate logical threads as green threads. · teavm.org, 8 Oct 2026
- Web focus
- TeaVM is primarily for web development, including building a front end alongside a Java backend or reusing some backend code in the front end. · teavm.org, 8 Oct 2026
- What it does
- TeaVM is an ahead-of-time compiler that turns Java bytecode into JavaScript and WebAssembly for browsers. · teavm.org, 8 Oct 2026
- Who it is for
- TeaVM describes itself as suited to Java, Kotlin, or Scala developers building a web front end or reusing backend code in a front end. · teavm.org, 8 Oct 2026
Where TeaVM stands on Freedom251
- Code Transpilers#26 of 28