You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide a complete beginner-friendly J2CL UI example with Maven setup #272
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
Activity
giavaneerspublicprojects commented on Jul 14, 2025
On Mon, Jul 14, 2025 at 8:36 AM grammaticon ***@***.***> wrote:
*grammaticon* created an issue (google/j2cl#272)
<#272>
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
—
Reply to this email directly, view it on GitHub
<#272>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALOWJEGPF4LGIQJXMS3MKAD3IPFAFAVCNFSM6AAAAACBPM7BQ6VHI2DSMVQWIX3LMV43ASLTON2WKOZTGIZDSMJYGEYTCNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Activity
giavaneerspublicprojects commentedon Jul 14, 2025
treblereel commentedon Jul 14, 2025
@grammaticon
Several articles are floating around the internet that were clearly generated by AI—for example, this one: https://www.javacodegeeks.com/introduction-to-j2cl.html.
They mistakenly refer to a j2cl-maven-plugin that doesn’t actually exist. You can use, for example, this one instead: https://mvnrepository.com/artifact/org.kie.j2cl.tools/j2cl-maven-plugin/0.23.3
we use it to build this project:
https://github.com/apache/incubator-kie-tools/tree/main/packages/serverless-workflow-diagram-editor
It's quite complex project with json/yaml marshallers, dependency-injection, html templated and so on
docs https://github.com/Vertispan/j2clmavenplugin
as an example, you can use https://github.com/treblereel/j2cl-tests, it's little bit outdated but it's a working example on simple j2cl app