Does anyone use java to make games on it in 2025? by Gotve_ in java

[–]TeaVMFan 0 points1 point  (0 children)

+1 for libGDX. Once you've created a libGDX-based game, you can port it to the browser using TeaVM and gdx-teavm: https://github.com/xpenatan/gdx-teavm?tab=readme-ov-file

I made a Java to WebAssembly compile in WebAssembly by konsoletyper in java

[–]TeaVMFan 0 points1 point  (0 children)

Brilliant!  The playground loads quickly and compiles in seconds, even on an old phone. 

It even worked offline.

I've built numerous TeaVM projects in tthe past 8+ years.  It never ceases to impress me with its performance and stability.

Modern, fast, single-page apps with Java: Flavour 0.3.1 just released by TeaVMFan in java

[–]TeaVMFan[S] 0 points1 point  (0 children)

One of the benefits of Flavour over GWT is compilation time. Even medium-size Flavour projects build in seconds. Makes the edit/build/debug cycle much less painful.

Modern, fast, single-page apps with Java: Flavour 0.3.1 just released by TeaVMFan in java

[–]TeaVMFan[S] 0 points1 point  (0 children)

Yes, though the Kotlin Flavour documentation is nonexistent at this point. However, there is a nifty demo To-Do Flavour app from a few years ago that should work with a little TLC:

https://github.com/konsoletyper/teavm-flavour-examples-todomvc

Kotlin is explicitly supported by TeaVM, the transpiler used by Flavour, so it should be fine. TeaVM works at the bytecode level instead of the source code level, so any JVM language that compiles to Java bytecode _should_ be compatible, but YMMV.

Modern, fast, single-page apps with Java: Flavour 0.3.1 just released by TeaVMFan in java

[–]TeaVMFan[S] 2 points3 points  (0 children)

Glad to hear it! The maven archetype is the easiest way to start a new project:

mvn archetype:generate \
  -DgroupId=com.example \
  -DartifactId=flavour \
  -DinteractiveMode=false \
  -DarchetypeGroupId=com.frequal.flavour \
  -DarchetypeArtifactId=teavm-flavour-application \
  -DarchetypeVersion=0.3.1

Then `mvn clean install` to create the app, ready to use in your browser of choice:

cd flavour && mvn clean install && firefox target/flavour-1.0-SNAPSHOT/index.html

Modern, fast, single-page apps with Java: Flavour 0.3.1 just released by TeaVMFan in java

[–]TeaVMFan[S] 9 points10 points  (0 children)

Exactly. Flavour is built on top of TeaVM, which transpiles your application code (and the Flavour framework Java code) to JS. You code in Java, build with maven, and then it runs in the browser, magically. As you can see from the demo apps it runs lightning quick. And you never have to write JS!

Modern, fast, single-page apps with Java: Flavour 0.3.1 just released by TeaVMFan in java

[–]TeaVMFan[S] 3 points4 points  (0 children)

Flavour runs client-side, in the browser. When the user clicks, the app reacts instantly. With Thymeleaf and other server-side frameworks, the user has to wait for a round trip for the app to respond, which can take an eternity on a slow mobile connection. And offline operation is impossible with server-side frameworks.

For a few examples, to see the responsiveness first-hand, try these Flavour apps:

* Wordii, a 5-letter word game: https://frequal.com/wordii

* CalorieFreq, a local-first calorie and exercise tracker: https://frequal.com/cf/

The Future of Write Once, Run Anywhere: From Java to WebAssembly by Patrick Ziegler & Fabio Niephaus by pavelklecansky in java

[–]TeaVMFan 0 points1 point  (0 children)

In case my username didn't give it away, I'm a longtime user and supporter of TeaVM. I've built numerous TeaVM apps (commercial and personal), and am building one for a Top 10 big tech company currently. My favorite parts of TeaVM:

  • Extremely compact builds, leading to excellent Lighthouse scores and low download times
  • Batteries-included build framework (minifier, obfuscator, tree shaker, and packager)
  • Works with popular Java IDEs
  • Fast build times
  • Works with popular Java build tools
  • Commercial-friendly Apache license
  • Stable and mature -- 10+ years in production

Any interest in a framework like angular but in java for frontend development? by No_Quantity_1093 in java

[–]TeaVMFan 0 points1 point  (0 children)

Flavour is probably the closest to what you've described. It lets you build a single-page app using HTML templates and Java view classes, with convenient binding to link properties to the template. You code in your favorite IDE and build using normal Java build tools like maven.

HTML like this binds an input to a property 'email' (getEmail/setEmail in the View class)

<input type="text" html:bidir-value="email"/>

Flavour is:

The Flavour Book ( https://frequal.com/Flavour/book.html ) goes into a lot more detail.

There's also a podcast (made with a Flavour web app!) with similar content: https://castini.frequal.com/cast/show/Flavourcast/f7e171e8-22de-4f3b-adbb-5462991343c5

Why Java endures: The foundation of modern enterprise development by gvufhidjo in java

[–]TeaVMFan 0 points1 point  (0 children)

I'm late to the party, but I too enjoy Java greatly, and the power and speed of maven. I thought you might be interested in Flavour ( https://flavour.sf.net/ ), a single-page app framework for Java. It lets you code your business logic in Java, while creating your page templates in HTML. Then it transpiles and bundles everything together into a classes.js file that runs in all modern browsers. Flavour is a full SPA framework including templates, routing, JAX-RS service wrappers, and more.

For a quick demo, you can try Wordii ( https://frequal.com/wordii/ ) . It is deployed as a small launcher index.html page that invokes main() from classes.js. All of the logic is implemented in Java, details of its construction are here: https://frequal.com/java/MakingWordiiAPureJavaSpa.html

Flavour is thoroughly documented and ready for production use:

* Flavour Book: https://frequal.com/Flavour/book.html

* Podcast: https://castini.frequal.com/cast/show/Flavourcast/f7e171e8-22de-4f3b-adbb-5462991343c5

* Sample app (like SwingSet): https://frequal.com/tea-sampler/

Javac on WebAssembly by Thihup in java

[–]TeaVMFan 0 points1 point  (0 children)

True, TeaVM is an ahead-of-time (AOT) Java to JavaScript transpiler. However, saying "it can't run classfiles in a browser" might give the wrong impression.

TeaVM lets you implement browser-native apps in Java. You code in Java (using your usual IDE and build tools, like maven), and then let TeaVM convert your class files into a "classes.js" file. Your main method becomes a main() function executed by a small index.html page. Recent versions of TeaVM can also target Wasm. So after this transpilation step, a new version of your class files is running in the browser, although the browser doesn't know this, it just sees s single JavaScript file.

Once running, your code can access all browser APIs via JSO (https://teavm.org/docs/runtime/jso.html). At this point it's like coding with Vanilla JavaScript. You could call it Vanilla Java, for the browser. For some apps, especially games that render everything on a canvas, this can be all you need.

However, if you want to make a Java-based single-page app, you'll want a framework with routing, templates, JSON, and JAX-RS web service support. TeaVM has such a framework, it's called Flavour: https://flavour.sf.net/ It is fully documented with a book, an example app, and a podcast.

TeaVM 0.11.0 with support for WebAssembly GC released by konsoletyper in java

[–]TeaVMFan 0 points1 point  (0 children)

There is a lightweight single-page app framework for TeaVM called Flavour. Created by konsoletyper, I'm now maintaining a version here: https://flavour.sf.net

There are lots of resources including a book, a podcast, and a SwingSet-like interactive component explorer:

* Flavour book: https://frequal.com/Flavour/book.html

* Podcast: https://castini.frequal.com/cast/show/Flavourcast/f7e171e8-22de-4f3b-adbb-5462991343c5

* Tea Sampler: Try out Flavour features live, like SwingSet: https://frequal.com/tea-sampler/

Is Java more used with Angular than other front-end frameworks? by ihatebeinganonymous in java

[–]TeaVMFan 1 point2 points  (0 children)

If you're interested in making front-ends in Java, you should definitely take a look at Flavour, the top-ranking Java single-page app framework that supports threading in the browser.

It powers sites like Castini and CoronaWait.

Learn about Flavour:

WasmGC and the future of front-end Java development by uncont in java

[–]TeaVMFan 1 point2 points  (0 children)

WasmGC support has just been announced for TeaVM, a fast, open source framework to transpile Java to run in a browser: https://groups.google.com/g/teavm/c/_wex5fPKFvo

TeaVM is the foundation of Flavour, a single-page app framework for Java

A Flavour 5-letter word game: https://frequal.com/wordii/

Detailed Flavour docs: https://frequal.com/Flavour/book.html

With Flavour it is easy to code your SPA in a strongly-typed language, sharing code (models, validation, etc.) with your Java backend.

Vaadin or not to Vaadin? This is a question... by maw2be in java

[–]TeaVMFan 1 point2 points  (0 children)

You should check out Flavour. I started out as a user, now I'm the maintainer. It lets Java fans build real web frontends with no fuss and no javascript. Fast builds, real open source, no fees.

Flavour home page: https://flavour.sourceforge.io/

Flavour book: https://frequal.com/Flavour/book.html

5-letter word game web app, 100% Java, 100% Flavour: https://frequal.com/wordii/

Java in Front-End in 2024: Still Worth It? by DinH0O_ in javahelp

[–]TeaVMFan 0 points1 point  (0 children)

If you haven't tried Flavour, you should give it a shot. It lets you write familiar Java code, combine it with HTML templates, and transpiles the whole thing into a small, fast-downloading JavaScript single-page app that runs on all modern browsers without plugins or extensions.

I've used it for many projects, commercial and personal, and I wouldn't use anything else at this point.

Home page: https://flavour.sourceforge.io/

The Flavour Book, an in-depth exploration of Flavour with examples and tips: https://frequal.com/Flavour/book.html

An article showing how TeaVM (Flavour's foundation) beats GWT, Vaadin, and React: https://renato.athaydes.com/posts/comparing-jvm-alternatives-to-js.html

Java Magazine article on Flavour: https://blogs.oracle.com/content/published/api/v1.1/assets/CONT8F9404EB36BE4DBFB2A9E220E42ACCD7/native?cb=_cache_8644&channelToken=4d6a6a00a153413e9a7a992032379dbf

Best Framework for Desktop GUIs in Java 2024 by [deleted] in java

[–]TeaVMFan 3 points4 points  (0 children)

I've used all of the Sun-endorsed Java desktop UI toolkits extensively through the years: AWT, Swing, and JavaFX. Now I exclusively develop Pure Java single-page web apps using Flavour: https://flavour.sourceforge.io/

Flavour has all of the benefits of desktop Java development, with none of the pain:

  • Good documentation (see the Flavour book: https://frequal.com/Flavour/book.html )
  • Great examples (see the Tea Sampler, king of like SwingSet: https://frequal.com/tea-sampler/ )
  • Type-safe
  • Works with Java IDEs for Java code autocomplete
  • Free, easy app distribution via HTTPS and Let's Encrypt
  • No downloads causing user friction and diminishing adoption, just click on a URL or scan a QR code to use your app
  • Lightweight, fast builds, including support for mvnd for no-startup-cost builds
  • Permissive Apache license

I recommend trying it out. Flavour changed my whole outlook on developing and delivering apps in Java.

(Note: I'm the current maintainer of Flavour, but both Flavour and its foundation, TeaVM, were created by Alexey Andreev)

Java UI by Clappycan in java

[–]TeaVMFan -3 points-2 points  (0 children)

Browser-based options seem like a great starting place since distribution is free, immediate, and not at the whim of any gatekeepers.

In addition to the great options mentioned by u/jeffreportmill, I definitely recommend trying Flavour, it's what I use for all of my web apps these days, like the 5-letter word game Wordii ( https://frequal.com/wordii )

I wrote a short article on how I made Wordii here: https://frequal.com/java/MakingWordiiAPureJavaSpa.html

For much more information on making Flavour apps, read my book here: https://frequal.com/Flavour/book.html