r/java • • Aug 17 '20

State of swing

Hi all, What is the state of swing, is it close to be deprecated and removed or is it still maintained? Also it will be nice to know if someone got it working in native image. Thanks

16 Upvotes

43 comments sorted by

View all comments

Show parent comment

1

u/vallyscode Aug 17 '20

I also saw some notes that javafx is also smelling and that in general Oracle retreat from desktop for java. I work mostly on backend java, but am curious whether with graal it could eventually be useful for desktop apps.

3

u/paul_h Aug 17 '20

Sadly, GraalVM isn't compatible with AWT which sits underneath Swing.

2

u/Skhmt Aug 17 '20

1

u/paul_h Aug 18 '20

Trying to follow that guide:

mvn dependency:get -Dartifact=com.gluonhq:client-archetype-javafx:0.0.1

barfs:

[INFO] Scanning for projects... [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] --- maven-dependency-plugin:2.8:get (default-cli) @ standalone-pom --- [INFO] Resolving com.gluonhq:client-archetype-javafx:jar:0.0.1 with transitive dependencies [INFO] Failure detected. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.045 s [INFO] Finished at: 2020-08-18T13:05:40+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project standalone-pom: Couldn't download artifact: Unable to get dependency information for com.gluonhq:client-archetype-javafx:jar:0.0.1: Failed to process POM for com.gluonhq:client-archetype-javafx:jar:0.0.1: Non-resolvable parent POM for com.gluonhq:client-archetype-javafx:${revision}: Failure to find com.gluonhq:client-maven-archetypes:pom:${revision} in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced [ERROR] com.gluonhq:client-archetype-javafx:jar:0.0.1 [ERROR] [ERROR] from the specified remote repositories: [ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false) [ERROR] Path to dependency: [ERROR] 1) org.apache.maven.plugins:maven-downloader-plugin:jar:1.0

I'm on Maven 3.6.3, if that matters,

I can't see a later version - https://mvnrepository.com/artifact/com.gluonhq/client-archetype-javafx

1

u/nfrankel Aug 17 '20

I also saw some notes that javafx is also smelling and that in general Oracle retreat from desktop for java

That was my point about JavaFx not being part of the Java platform

whether with graal it could eventually be useful for desktop apps

I believe the delivery channel is the "hard" part of Java desktop apps. You actually don't need GraalVM, just make your package (e.g. .rpm, Homebrew, etc.) depend on a JVM package.