Go to file
2017-02-16 22:20:49 +03:00
.idea Fix bugs in metaprogramming. Add run configuration that rebuilds TeaVM 2017-02-04 18:24:23 +03:00
all-deps Fixing building idea plugin 2016-09-17 11:45:15 +03:00
classlib Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
core Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
extras-slf4j Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
html4j Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
interop/core Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
jso Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
metaprogramming Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
platform Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
samples Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
tests Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
tools Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
.gitignore Remove unnecessary IDEA project files 2016-10-27 12:55:28 +03:00
.travis.yml Replace build version suffix with 'dev' 2017-02-16 22:20:49 +03:00
checkstyle.xml Migration to IDEA 2016-02-07 14:28:51 +03:00
LICENSE Applies apache license 2013-12-20 12:45:28 +04:00
license-regexp.txt Fix build. Apply rules to some classes of teavm-classlib 2015-07-23 15:31:49 +03:00
NOTICE Borrow some code from Joda Time to parse tz data and expose offsets. Add 2015-05-13 22:57:00 +03:00
pom.xml Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00
README.md Update README.md 2015-12-31 09:34:58 +03:00
set-version.sh Update set-version script 2015-12-26 15:04:44 +03:00
travis-settings.xml Set version to 0.5.0-SNAPSHOT. Add configuration to deploy to bintray. Update version number during Travis build. 2017-02-16 21:48:13 +03:00

TeaVM

Build Status

What is TeaVM?

TeaVM is an ahead-of-time translator from Java bytecode to JavaScript. It can be compared with GWT, however TeaVM does not require source code of your application and all required libraries. You can use TeaVM for building applications for the browser, due to the following features:

  • per-method dependency analyzer, that determines a set of methods that are really needed to run your application, so TeaVM won't translate whole JAR files;
  • fast JavaScript; for now it is almost as fast as the JavaScript, generated by GWT;
  • Java class library emulation;
  • integration with Maven and Eclipse;
  • generation of source maps;
  • debugger;
  • interoperation with JavaScript libraries together with the set of predefined browser interfaces.

Quick start

There are several options of using TeaVM. One is the Maven build. The easiest way to create a new TeaVM project is to type in the command line:

mvn -DarchetypeCatalog=local \
  -DarchetypeGroupId=org.teavm \
  -DarchetypeArtifactId=teavm-maven-webapp \
  -DarchetypeVersion=0.4.3 archetype:generate

Now you can execute mvn clean package and get the generated war file. Deploy this war in Tomcat or another container, or simply unzip it and open the index.html page.

It is much easier to develop TeaVM applications using Eclipse. If you prefer Eclipse, please read this tutorial.

To learn TeaVM deeper, you take a look at the samples module, containing examples of TeaVM-based projects. Also you can read project's wiki.

DukeScript

DukeScript is a set of APIs that allows Java applications easily talk to JavaScript environment to (usually) animate an HTML page. While DukeScript has its own implementation of JVM, called Bck2Brwsr, TeaVM also provides support for running DukeScript applications, using teavm-html4j plugin.

Live examples

Compare the speed of JavaScript produced by TeaVM and GWT here: http://teavm.org/live-examples/jbox2d-benchmark/

Play Geobot, a little physics-based puzzle game. Thanks to joan789 for her great artwork!

Thanks to Jaroslav Tulach, author of DukeScript, we have several DukeScript example applications. One is the minesweeper game. You can try its TeaVM-compiled version here, and then take a look at source code and HTML page.

Another example is available here. It uses GraphHopper to build route in browser. Unlike original GraphHopper example it works completely in browser instead of querying server. Thanks to Peter Karich.

Feedback

Ask your questions by email: info@teavm.org. Also you can report issues on a project's issue tracker.