jdeploy
cljfx
Our great sponsors
- CodiumAI - TestGPT | Generating meaningful tests for busy devs
- ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
- Sonar - Write Clean Java Code. Always.
- InfluxDB - Access the most powerful time series database as a service
jdeploy | cljfx | |
---|---|---|
14 | 16 | |
307 | 863 | |
- | 0.8% | |
9.4 | 3.1 | |
2 months ago | 13 days ago | |
Java | Clojure | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
jdeploy
- How do you usually deploy Java Swing application in Windows machine, so that it can pass Microsoft Defender SmartScreen checking?
-
How do you package your Swing app?
See http://www.jdeploy.com/
-
How do I finish a JavaFX project?
You could try jdeploy as well.
-
Conveyor + AtlantaFX theme sampler case study
Why would someone use conveyor over https://www.jdeploy.com/
-
What does everyone use for GUI work?
Agree. For quite a while it was hard to deploy JavaFX applications but jpackage exists now. There are also tools out there which do everything for you :https://www.jdeploy.com/https://conveyor.hydraulic.dev/1.0/
-
New tool for packaging JVM apps, an alternative to jpackage
How does it compare to jdeploy?
- Any ideas to convert my jar file / eclipse project to exe?
- Is is possible to ship Java app with Embedded JVM?
-
Java: "write once, run everywhere" vs "build once, run everywhere"
You can try https://www.jdeploy.com. I didn't try it yet. I use GitHub Actions which allow me to deploy to all platforms by just pushing to the master branch (or whichever you set up). It's free for a certain amount of machine runtime minutes. Shouldn't be a problem for a personal application.
-
The Decline and Fall of Java on the Desktop Part 1 (1999-2005)
You build your Clojure app as an uberjar, yes. Only gotcha here is to remember "-Dcljfx.skip-javafx-initialization=true" so the JFX thread doesn't get started during build, and I've had no problems using Clojure's direct linking either. You use jlink[1] to create a custom runtime JRE image (this isn't strictly necessary if you're deploying to machines with a JRE but it cuts down on moving parts and gives you more control). jpackage[2] then takes that runtime image and your uberjar and creates installers for Mac/Windows/Linux. Both are command line tools, and we just have GitHub Actions that cut new releases for each platform when we tag something with a new version.
Worth also keeping an eye on jDeploy[2] which adds extra goodies like auto updates, at the cost of some npm shenanigans. Not something I've played with yet though.
1: https://docs.oracle.com/en/java/javase/17/docs/specs/man/jli...
2: https://docs.oracle.com/en/java/javase/17/docs/specs/man/jpa...
cljfx
-
Advice for peeking into the Lisp family (CL vs Scheme vs Racket...)
For desktop, there is cljfx which is a JavaFX wrapper, and has a similar API to reagent.
-
Transcending Posix: The End of an Era?
If you have an application server then you still have RPCs coming from your user interface, even if you run the whole DB in process. And indeed POSIX has nothing to say about this. Instead people tend to abuse HTTP as a pseudo-RPC mechanism because that's what the browser understands, it tends to be unblocked by firewalls etc.
I think there's a better way to structure things to get that same simplicity and in fact even more, but without many of the downsides. I'm planning to write about it more at some point on my company blog (https://hydraulic.software/blog.html) but here's a quick summary. See what you think.
---
In a traditional 3-tier CRUD web app you have the RDBMS, then stateless web servers, then JavaScript and HTML in the browser running a pseudo-stateless app. Because browsers don't understand load balancing you probably also have an LB in there so you can scale and upgrade the web server layer without user-visible downtime. The JS/HTML speaks an app specific ad-hoc RPC protocol that represents RPCs as document fetches, and your web server (mostly) translates back and forth between this protocol and whatever protocol your RDBMS speaks layering access control on top (because the RDBMS doesn't know who is logged in).
This approach is standard and lets people use web browsers which have some advantages, but creates numerous problems. It's complex, expensive, limiting for the end user, every app requires large amounts of boilerplate glue code, and it's extremely error prone. XSS, XSRF and SQL injection are all bugs that are created by this choice of architecture.
These problems can be fixed by using "two tier architecture". In two tier architecture you have your RDBMS cluster directly exposed to end users, and users log in directly to their RDBMS account using an app. The app ships the full database driver and uses it to obtain RPC services. Ordinary CRUD/ACL logic can be done with common SQL features like views, stored procedures and row level security [1][2][3]. Any server-side code that isn't neatly expressible with SQL is implemented as RDBMS server plugins.
At a stroke this architecture solves the following problems:
1. SQL injection bugs disappear by design because the RDBMS enforces security, not a highly privileged web app. By implication you can happily give power users like business analysts direct SQL query access to do obscure/one-off things that might otherwise turn into abandoned backlog items.
2. XSS, XSRF and all the other escaping bugs go away, because you're not writing a web app anymore - data is pulled straight from the database's binary protocol into your UI toolkit's data structures. Buffer lengths are signalled OOB across the entire stack.
3. You don't need a hardware/DNS load balancer anymore because good DB drivers (e.g. JDBC drivers) understand clustering and load balancing directly.
4. You don't need to design ad-hoc JSON/REST protocols that e.g. frequently suck at pagination or handling of large results, because you can just invoke server-side procedures directly. The DB takes care of argument serialization, streaming of results, type safety, access control and more.
5. With some databases like PostgreSQL you get server push/notifications for free.
6. The protocol gives you batching for free, so if you have some server logic written in e.g. JavaScript, Python, Kotlin, Java etc then it can easily use query results as input or output and you can control latency costs.
This architecture lacks popularity today because to make it viable you need a few things that weren't available until very recently (and a few useful things still aren't yet). At minimum:
1. You need a way to distribute and update GUI desktop apps that isn't incredibly painful, ideally one that works well with JVM apps because JDBC drivers tend to have lots of features. Enter my new company, stage left (yes! that's right! this whole comment is a giant ad for my product). Hydraulic Conveyor was launched in July and makes distributing and updating desktop apps as easy as with a web app [4].
2. You need databases with really flexible ACLs. Free DBs like PostgreSQL didn't support RLS until somewhat recently.
3. You need solid UI toolkits with modern themes. JetBrains has ported the new Android UI toolkit to the desktop [5] allowing lots of code sharing. It's reactive and thus has a Kotlin language dependency. JavaFX is a more traditional OOP toolkit with CSS support, good business widgets and is accessible from more languages for those who prefer that; it also now has a modern GitHub-inspired SASS based style pack that looks great [6] (grab the sampler app here [7]). For Lispers there's a reactive layer over the top [8].
4. There's some smaller tools that would be useful e.g. for letting you log into your DB with OAuth, for ensuring DB traffic can get through proxies.
Downsides?
1. Migrating between DB vendors is maybe harder. Though, the moment you have >1 web server you have the problem of doing a 'live' migration anyway, so the issues aren't fundamentally different, it'd just take longer.
2. Users have install your app. That's not hard and in a managed IT environment the apps can be pushed out centrally. Developers often get hung up on this point but the success of the installed app model on mobile, games consoles and Steam shows users don't actually care much as long as they plan to use the app regularly.
3. To do mobile/tablet you'd want to ship the DB driver as part of your app. There might be oddities involved, though in theory JDBC drivers could run on Android and be compiled to native for iOS using GraalVM.
4. Skills, hiring, etc. You'd want more senior devs to trailblaze this first before asking juniors to learn it.
[1] https://www.postgresql.org/docs/current/ddl-rowsecurity.html
[2] https://docs.microsoft.com/en-us/sql/relational-databases/se...
[3] https://docs.oracle.com/database/121/TDPSG/GUID-72D524FF-5A8...
[4] https://hydraulic.software/
[5] https://www.jetbrains.com/lp/compose-mpp/
[6] https://github.com/mkpaz/atlantafx
[7] https://downloads.hydraulic.dev/atlantafx/sampler/download.h...
-
Conveyor + AtlantaFX theme sampler case study
JavaFX is a mature and powerful toolkit easily accessed from many different languages. You don't have to use Java and can even layer on top entirely different paradigms, like cljfx does with a ReactJS/Compose style functional rerendering system. It's also accessible to Truffle languages. But the default Modena theme looks dated, and JavaFX lacks a small number of standard modern controls like an animated toggle switch.
-
I'm still using Swing in 2022. Change my mind!
cljfx is awesome
Maybe because: https://github.com/cljfx/cljfx
-
Ask HN: Does Java need a modern Java UI toolkit for desktop/web?
Super excited about this. I've been using cljfx (https://github.com/cljfx/cljfx) to build a few apps and it's so developer efficient.
-
The Decline and Fall of Java on the Desktop Part 1 (1999-2005)
In Clojure you can use JavaFX through cljfx
https://github.com/cljfx/cljfx/
I haven't used React, but I think it's very similar. You have a datastructure that represents the GUI and associated callbacks that modify the GUI. It doesn't use hiccup, but it's a similar structure. I've got to say it was fantastic. The least painful GUI programming I've ever done. The core architecture isn't opinionated so there is a little boilerplate to setup at first, but then it's very smooth sailing. I release an app using it and it was very performant, used some Java CV libs and drew diagrams to the canvas and it was all very snappy.
My only minor complaint was that the final bundle was like 150MB, which given the scope of the app seemed a bit gross - but it's manageable. In theory you could trim that further with GraalVM
I've made a few desktop apps in https://github.com/cljfx/cljfx (e.g., https://www.chronos-desk.com/), and cljfx (JavaFX + Clojure) is amazing and makes for rapid development, not to mention fun. I'm keeping an eye on https://github.com/HumbleUI/HumbleUI, which promises to be a step up.
-
The Clojure Mindshare (2019)
Emacs/Cider - https://docs.cider.mx/cider/index.html
> and library ecosystem (building websites, parallelism, GUI, etc...)
Websites - Reagent, a ClojureScript wrapper for React https://github.com/reagent-project/reagent
GUIs - Clojure has the entirety of Java to steal GUIs from - Ex: https://github.com/cljfx/cljfx
Just because the Lisp family is old and has a simple syntax does not mean it's an antiquated language or that there are not new developments going on there.
-
What is your take on the current state of JavaFX as a GUI library?
There's https://github.com/cljfx/cljfx which turns it into something like React. And you can use the opportunity to learn Clojure ;)
What are some alternatives?
artipie - Binary Artifact Management Tool
Getdown - Download, Install, Update
skija - Java bindings for Skia
FxThemes - A collection of general JavaFX themes
iup - Common Lisp CFFI bindings to the IUP Portable User Interface library (pre-ALPHA)
re-frame-flow - Graph based visualization tool for re-frame event chains
HumbleUI - Clojure Desktop UI framework
FlatLaf - FlatLaf - Swing Look and Feel (with Darcula/IntelliJ themes support)
seesaw - Seesaw turns the Horror of Swing into a friendly, well-documented, Clojure library
jfx - JavaFX mainline development
warp - Create self-contained single binary applications
cljs-tui-template - A leiningen template to generate ClojureScript Terminal-User-Interface applications built on web technologies you already know.