Java is one of the few ecosystems that provides a software distribution ecosystem that doesn't allow distribution of sources alongside binaries. Additionally, it is a lot more common for Java dependencies to be a game of Jenga. Take for example, Gradle. Gradle literally cannot be built from source[1] because it relies on a binary cache of dependencies held by Gradle to build Gradle. There are many other examples of this. As a consequence, the Java ecosystem has become a security and maintenance nightmare that other ecosystems simply aren't.
As bad as Nodejs is, it doesn't do this. As difficult as .NET has been, the dependency hygiene is better there. As annoying as Go and Rust are, they provide better guarantees in their ecosystems than Java does. While Python and Ruby are "slower" than Java, they both make it up in developer productivity and transparent, well-reasoned tooling compared to Java.
[1]: https://twitter.com/decathorpe/status/1250048390228041729
Java is fine language and the JVM is a great runtime, but unfortunately the language itself is like a bug zapper light for graybeard enterprise devs who are not so much "Java developers" as they are "Spring engineers" (though they often refer to themselves as architects). They usually have a flair for overly complex abstraction and an encyclopedic knowledge of a couple decades worth of Spring spells, er, annotations.
They typically don't build as much as they just hook shit together with Spring. Every solution is always, "oh just use yadda yadda Spring annotation/plugin." Sometimes it works, often you end up spending the day learning about yet another convoluted hunk of shit that your project just absorbed. Every Spring project turns into a myriad of black boxes where everything happens everywhere else and you're always just a few plugins short of having what you need.
For enterprises this works... okay. They're big and they have a lot of money, so they usually prefer slow, complex, and consistent over rapid development dice rolls. For startups, a seasoned Java enterprise dev is like a rat. If you let one get in the door you're going to be dealing with a fucking mess in no time.
I’ve seen startups use almost every language under the sun, including the boring ones like Java, C, and PHP.
It's not Javas fault, it's Springs fault.
2. They believe Java is slow, but fail to realize that the JVM has actually one of the most optimized runtimes under the sun and can be fast than (unoptimized) C in many cases.
Long story short: Because they have no clue about Java and follow advice without researching it first.
So you need to do things to convince the hotshots to come work for you, and Java is boring corporate coding, it's not the latest hotshit like Rust is.
And conversely, they're also negotiating with VCs for funding, and customers. Being able to describe the hotshot language helps differentiate as to why "this startup will make it work".
Python shops weren't much better. Enormous products of complexity, plugin frameworks to config other plugins...
Go is not without its problems but at least it reins in much of the dynamic complexity (although systems like K8S built above it seem to add it back). For a lot of things it's better than Java or Python.
I haven't yet worked at a Rust shop but I've used it on a few small things of my own and it seems to strike a good balance and Rust/Wasm looks really promising.
So if I have the choice I'll go with a Rust startup, a Go startup, a Python/Java startup in that order.
But I've worked in two startups, one sold for $600M and one sold for $200M and both were Java based (The startup I co-founded used Scala (never again ;-) on the JVM eco system and was also successfully sold, though for less than $200M)
Technologies come and go (and sometimes come back like Python). When I started Java in the 90s it was replacing often Perl on the server, as the first apps were writen by Unix admins who used Perl, which went out of fashion.
Kotlin and Scala are different from what I understand.
Also, from what I can gather, most developers entering the industry come with JavaScript and Python experience. So there's that to consider.
* lack of user-friendly UIs in the end product
* super frustrating *NullPointerException* showed to confused users in (almost) all java programs they get close to - despite java enthusiasts assuring that good programs should not feature that.
* annoying frequent update popup shown to end users, with bloated process pushing to install other unrelated stuff
* creating a super tiny dependency program in java results in a hundreds-megabytes distributable because (??)
* heavy and bloated IDEs
* confusing JRE / JDK required installs
* licensing confusion once Oracle made Oracle Java SE paid
* supposed to be multi-platform but tricky to make it work well on some versions of linux (painful memories using pentaho or gephi, finding the right file where to set-Xms -Xmx flags after a crash)
As many others in this thread have said, using a newer (Go is 10 years old) stack is appealing to VC's, and the hotshot programmers you're trying to attract and trade salary for stock options. This is the best strategy.
If you really need to use the JVM for some reason then consider using another language on top of it such as Kotlin or Clojure. In 2022 saying your hot new startup is using Java is pretty much equivalent to saying you're using Cobol. Don't be surprised if it doesn't generate much interest from investors or developers.
Java isn't particularly fun or thrilling to write. If you're a founding CTO or a founding team of engineers, of course you're going to choose something more "interesting" for a greenfield project.
Java isn't as quick and dirty as other languages. I think this almost fully explains the prevalence of node, because after being stuck in the node ecosystem for two years, I truly can't imagine why anyone would choose to build anything substantial in node.
Also, a lot of research in ML is done in Python, and there are quite a lot of startups doing ML, so Python is a natural choice. Same for data science.
That being said, it wouldn't be the worst thing for me to start with Java
We're talking about Oracle here.
I've heard its gotten better in recent years but why bother?
- you want the jvm libraries? kotlin is a much cleaner syntax that also runs on android and can be compiled to js.
- need speed? rust is hot and has a lot of mindshare going into it as we speak.
- Need cheap devs you can rotate out on your pivot cycle till you land on a viable business model? javascript lets you build your whole stack in the same language with a large pool of junior to senior talent.
- need websocket or realtime? elixir wins the day there.
- ml? you night have a contender here. jvm based projects like spark and hadoop use the jvm. extensively. That said, scala seems more widely used in production there but its not a field I'm super close to so I could be mistaken.
I guess what I'm trying to say is that java isn't particularly bad but it doesn't have an edge either. there's nothing compelling in it thats going to give you an edge in delivering value to the users.
I've never been a Java dev, but as I understand the package manager story is/was really bad. I've always wondered if that's part of the reason why you see so few open source efforts compared to other languages.