[0] as in not-statically-compiled, Java may be statically typed but the platform is very dynamic
[1] CLR/C# perhaps, but don't know too much about it, I believe its approach is less dynamic and more ad hoc, it can do some things better but perhaps for the wrong reasons.
Java has come a long way, 17 has a lot of nice language features and Amber, Panama, Loom, Valhalla are all doing great things for the JVM.
There's also the excellent ecosystem, and some of the Kotlin libraries have quite nice APIs.
I think tooling is a plus too, Gradle is a flexible and extensible build tool. I've also been experimenting with Graal, I'm not committing to using it, but it does look very promising (and has an easy to use plugin for Gradle). We could use it to build some very slim Container images, if it works out.
Except maybe some infra constraints related to big data or legacy systems interconnectivity.
In the worst case scenario I would stick to JVM, but not to Java language.
Main reason — poor dev experience (for 90-s it was awesome), far outweighed by modern “light” alternatives, like node, go, ruby, python etc.
And dev perfomance is #1 factor of any project’s success/failure. On account that even lowest salaries are magnitudes higher than cpu/memory costs.
- Built on top of the JVM
- Large number of 3rd libraries, i.e. Jackson, Jetty, Spring Boot, Hibernate, etc.
- Mature, can find support in numerous areas
- Dependency management, I'm sure many will disagree but I've found Maven to work well enough for what i need it to do both from dependency management and releasing
- It's the language I'm the most efficient with and if I'm building something brand new I favor speed of iteration over having to stumble over learning a new language. NOTE: I'd say the same thing about C#, Swift, Javascript, etc. If that either of those were my primary language I'd do the project in that because speed is your friend when starting out.
I'd like to ask 'why not' - Java is supported, fast enough for lots of applications and a great ecosystem of third party libraries.
It's hard to sell them new features/projects when their devs cannot decypher the language you used. (Eg. scala) You can't really put a finger on what you gain from using a new language apart from it's harder to find someone to work with it an he will ask for more money.
Yeah there is the programmer centric "progressive tech stuff are FUN" view but business usually don't care...
Use java until you just can't bear it. You may get bored of it, we are humans after all. Ill even claim its desirable to build enough experience to be bored of it. Ideally, by this time you'll have developed the skills needed to evaluate a technology for adoption. At minimum, use java until you have learned this skill.
* Spring Boot for web services and application. Absolutely amazing and easy to use, my favorite feature is easy integration with external authentication services. Yet there is no longer much Scala support around for Scala and the Spring framework. Clojure may be a bit better in this case as Clojure collections implement the Java collections interfaces unlike Scala. Another issue is heavy use of reflection by frameworks like Spring which tends to work poorly with Scala.
* Android applications. Dalvik is a register based and not a stack based VM; scalac produces code optimized for OpenJDK which may run inefficiently on Dalvik.
That said in these cases you have the option of using Kotlin. While it does not differ terribly from Java, it supports pattern matching (which I don’t believe is supported by Java, but I may wrong as I haven’t used versions higher than 8 extensively.)
Java has stronger compile time checks than many other languages. The JVM supports several other languages. For long running processes the warm-up time experienced with JITs might be of minimal concern.
A critical skill is to sufficiently understand the incompletely defined application in order to choose the most appropriate language(s), framework, environment, infrastructure, tooling. Of course, the experiences and competencies of the development team should also be taken into consideration.
However, Java runs on more devices than anything else right? It's still a major player and I can't imagine it going away anytime soon.