Bck2BrwsrViaCLI

From APIDesign

The Bck2Brwsr project is publishing artifact snapshots to Maven repository since Feb 13, 2013. That means there is an easy, three steps, way to start coding for the browser yourself. All you need is Java and Maven installed.

Possibly replace the 1.1.2 version with newer version if/when available.
Maven will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder and execute following command in it

$ mvn -Pfxbrwsr clean package exec:java

to run the application in FXBrwsr mode (suitable for debugging). To run the application in real browser, use:

$ mvn -Pbck2brwsr clean package bck2brwsr:show

Of course, you don't have to work only from command line. Good IDEs, including NetBeans will recognize the generated project without any struggle and provide you all the comfort you are used to when coding in Java.

Deploying to Server

When your application is ready you can easily deploy it to a server as a set of static pages:

Yesterday we (Jonathan Fuerth watched by me) managed to open the generated (and compiled) project in Eclipse. Showed up without errors after adding target/generated-sources/annotations/ as additional source path root. The support for AnnotationProcessors was limited, when we added new @Property(...), we needed to recompile for the IDE to realize what is going on. However the behavior seems acceptable and certainly better than I expected given the fact nobody tested it and designed for it yet.

Deploy as a Desktop Application

One can also build classical Java desktop application and deploy it to users as a ZIP file:

Maven will download its libraries. Then it asks few questions (for example name of the project you want to create) and generates the skeleton project for you. When the project is successfully created, switch to the created subfolder:

A browser window opens and you can check how easy it is to synchronize content of various elements on the HTML page, to compute derived properties and how to draw a text on an HTML canvas.

Of course, you don't have to work only from command line. Good IDEs, including NetBeans will recognize the generated project without any struggle and provide you all the comfort you are used to when coding in Java.