-
Notifications
You must be signed in to change notification settings - Fork 154
Description
Hello J2CL team and community,
I’ve been trying to explore J2CL for a Java-to-JS project. The technology is very promising, but in its current form it is very difficult to use for developers who are not already familiar with Google's tools and GitHub.
Several issues are blocking for newcomers:
The official examples are extremely minimal (typically just printing "Hello World" to the browser console).
There is no full example showing how to build a simple interactive UI.
The directory structure and Maven setup are unclear for someone outside Google.
The plugin version (j2cl-maven-plugin) is not available from Maven Central and must be fetched from a separate repository, which is undocumented or not clearly explained.
On Windows, additional steps are required to set up Maven and make the plugin usable in user mode (e.g. configuring PATH, handling .m2 repository, etc.).
There is no tutorial showing:
Where to place the .java files
What the full pom.xml should contain
Where to place the .html and .css files
How and where to copy the output files after compilation
What command to use to compile and where to look for errors
For example, a very useful tutorial could be:
A small webpage with a visible button. When the button is clicked, a colored circle appears below it, drawn via DOM manipulation triggered by Java code compiled via J2CL.
This would demonstrate how to:
Interact with the DOM using Java
Use J2CL and Maven together
Serve a working HTML/CSS/JS page locally
Understand the full project layout
This kind of realistic and visual example would help a lot of Java developers adopt J2CL more easily. If a working template already exists with all files and structure included, I’d be grateful for a link.
Otherwise, I’d be happy to contribute or test such a project if the team wants to initiate one.
Thank you for your work — J2CL is a great idea, and I hope it becomes easier to discover and use for the broader Java community.
Best regards,
Jean-Pierre Desmoulins