r/java • • Aug 24 '26

Usage of Java in non-web development domains, and Greenfield projects.

Greetings.

(I will beat around the bush a bit before getting to the point, you can scroll down a bit to save time)

Java currently shines at enterprise backend applications, being led by the big players like Spring and Quarkus. However Java seems more than capable for other domains, yet no one talks about it, or even considers Java for normal non-web projects.

Take desktop development for example. JavaFX is one of the BEST GUI frameworks I have ever used. It is feature packed, doesn't require cryptic symbols, no fancy way of nesting code blocks to create simple UI. It is very simple to use, yet powerful and robust.

Game Development is a bit weak, but we still have libGDX and LWJGL. They are packed with features, even 3D. Contrary to popular belief that libGDX is a 2D only framework, libGDX has some great 3D support like GLTF rendering, bullet physics, PBR rendering and skeletal animations.

Big data processing and simulation systems, Java's OOP nature really helps to solve certain problem statement that requires the problem to be broken down into multiple pieces.

And finally web development, there is no doubt Java has one of the best ecosystems for the web.

And yet despite all this, Even as modern Java has come a long way, Java continues to have a negative reputation of being slow, boilerplate, RAM consuming memory hog. (The same people will use electron to make a desktop app btw) and as a result not considered for newer projects.

When I look at other communities like JavaScript, Rust, python, C#, Zig. These languages are often considered first options for any Greenfield projects. The open source communities in these languages are very active, you will see some amazing work being put out by the community.

Java seems to lack that "community" nowadays. I am active in a lot of subreddits and forums, and I see very less of Java projects in the wild. Java is being used in production out there, but modern greenfield projects are leaning more towards Go and C#.

So getting to the point of the post

Is Java seeing a decline? This is not a "Java dead" post but a genuine concern. The community for Java just seems.... dull. And I was wondering what could be done about this. Amongst new and modern programmers, Java and C++ seem to be considered "old", "dead" and "traditional"

Perhaps project Valhalla could help, but I wonder how much would it help restore Java's PR. Oracle is definetly NOT helping with this.

Why does this matter in the first place?

You may think "it doesn't matter what others think, companies still want Java" and while it holds some truth, more and more of Open source development seems to be moving towards other languages. A lot of Java libraries and frameworks have seen some decline, the community seems to be becoming more inactive. Other programming languages and frameworks have active discord servers, forums, documentation, and participation while Java seems a bit slow there.

I dont know, I really love Java as a language. And I wish it had more adoption in non-enterprise domains. I would genuinely like to know, what we as a community can do to make Java more "loved" and preferred

91 Upvotes

130 comments sorted by

View all comments

Show parent comment

3

u/istarian Aug 25 '26 edited Aug 25 '26

Unless you are using a native compiler, Kotlin is a 'JVM-hosted' language and fundamentally Java adjacent.

I think that Kotlin vs Java is probably a matter of personal taste in many respects.   Personally I much prefer explicit termination of statements over relying on whitespce and software just figuring it out.

2

u/genericallyloud Aug 25 '26

In the context of Android architecture, there technically is no JVM. That might seem like splitting hairs since it is still fundamentally based on JVM bytecode, but it does get compiled to DEX bytecode during the building/packaging process. Targeting the JVM bytecode as input makes it easier to work across JVM languages, but it would certainly be possible to compile directly from Kotlin to DEX and bypass the JVM. If anything, the real dependency is to the JRE, which Android does still use.

2

u/pjmlp Aug 26 '26

This is also a thing in certified JVMs like PTC, Aicas, IBM i, z/OS implementations.

Additionally, one of Kotlin selling points is the ability to consume Java ecosystem, pretty much useless without it, the proof being the alternative implementations are barely used at scale outside Android or Spring.

1

u/istarian Aug 25 '26

It most definitely is splitting hairs given that you can, at least in principle, have a Java Virtual Machine (JVM) that wasn't developed by Sun Microsystems or Oracle.

I would consider the Dalvik VM to be functionally equivalent to having a JVM, especially if you compile Java or Kotlin first to JVM bytecode and then translated it to DVM (?) bytecode.

Google took a particular route to try and avoid being sued by Oracle/Java, but the end result probably wouldn't have existed if Java and the JVM didn't come first...

2

u/koflerdavid Aug 27 '26

Dalvik VM

Modern Android versions don't use Dalvik anymore; only the DEX file format survives for packaging. Instead it is nowadays called the Android Runtime (ART, which is a very creative name, pun not intended) and apps are compiled ahead of time to native code for performance.

1

u/istarian Sep 02 '26

DEX -> Dalvik Executable

That's literally the executable bytecode for a Dalvik VM. The primary difference here is that "Dalvik" is synonymous with JIT (just in time) compilation.

The Android RunTime (ART) is not fully AOT (ahead of time), at least not anymore based on a quick google search...

To improve on this, a hybrid approach was introduced in Android 7.0 (Nougat). Newly installed apps run using JIT compilation, and get profiled by the runtime. When the device is idle and charging, the runtime performs AOT compilation on the most frequently used ("hot") code.[7]"

https://en.wikipedia.org/wiki/Android_Runtime

1

u/koflerdavid Sep 02 '26 edited Sep 03 '26

However, there is no Dalvik VM anymore, for... reasons. My guess they are keeping the reason because of a mix of having experience and tooling and tons of legacy apps using that format and the possibility of being insulated from the JVM ecosystem.

1

u/istarian Sep 06 '26

Sounds like a nitpick to me when you're still using the same bytecode format and JIT compilation is still part of execution.

You mostly aren't running pure C++ applications on any Android device.

1

u/genericallyloud Aug 26 '26

Well I mean, its a very practical choice to use JVM bytecode as the starting point, because then its a single target that works with all JVM languages. The fact that it gets recompiled to an entirely different bytecode optimized for android means the original bytecode wasn't really ideal. And at this point, removing support for the subset of JRE API's would be completely brutal for no reason. So they are quite literally locked in to the JVM bytecode for input and JRE-subset support for runtime. I think that's plenty to support it being Java adjacent forever.

However, since I was splitting hairs, I think its become more dependent on Kotlin than it ever was on Java. You can't even actually write modern Jetpack Compose components with Java - its Kotlin only. It very specifically leverages syntactic features of Kotlin that aren't in Java.

Especially under the context of the OP talking about JavaFX, Java for desktop, and Java based games, I think that pointing to Android is a little misleading and the hair splitting gets more meaningful. Mobile games are generally native code, not JVM at all. The bytecode is dex and runtime is ART (in many ways supporting the claims of performance issues for the JVM by building an entire alternative stack to make it work for mobile. no JavaFX or Swing code here), and finally, you can't even actually write a modern Android app in the latest first party UI framework using Java. (so at least the UI code is Kotlin)

So yeah, Android is definitely Java adjacent, and probably always will be. I don't know that it strongly counters the feeling that Java the language or JVM the runtime are a poor fit outside of web/enterprise. In many ways, it supports that claim by making dex and ART (which are tuned very differently than the JVM) and pushing the switch to Kotlin because Java + XML had a pretty bad rap for being clumsy and verbose.