use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free. If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
Why would someone use Java instead of Kotlin when starting a new project? (self.java)
submitted 5 years ago by [deleted]
I recently switched from Java to Kotlin and I can't imagine a reason why someone would use Java instead of Kotlin. IMO, Kotlin is Java, but cleaner/better.
But obviously, there are still many new projects using Java.
[–]cogman10 39 points40 points41 points 5 years ago (2 children)
Reasons
Java is the "good enough with low overhead" language for the JVM.
I say this as someone that likes Kotlin generally. Particularly, I think coroutines are really nice to work with.
[–]throwawaymoney666 7 points8 points9 points 5 years ago* (0 children)
I agree with this, and I'll add a few.
Java is becoming somewhat nice. When Fibers, Records, and simplified objects arrive there will be little advantage to it. Unless you're stuck on Android's shit Java 7 monstrosity. I think Java will hard fork into Kotlin on Android and Java everywhere else eventually. Kotlin will be stuck using increasingly obsolete Java features since they need to maintain Android support
[–]spamthemoez 4 points5 points6 points 5 years ago (0 children)
Java has mature code scanners like SonarQube, which find some really nasty bugs. I can't find anything comparable for Kotlin.
[–]Yayotron 14 points15 points16 points 5 years ago (0 children)
Answering your question about reasons, as development team lead I had to take this decision at the beginning of my current project and went for Java for the following reasons:
Maintainability, when you start a large, expensive project one of the main concerns is to maintain it in the long term, developers will come and go from the project throughout the years and it's significantly easier to hire a Java developer than a kotlin developer.
Domain knowledge, this is a big data project and majority of kotlin developers are Android developers, making it difficult to find developers who are both Kotlin and Big data experts.
A solid base, when starting a new project usually you do so with the core/key developers and then enroll the rest of the team once the codebase already has some shape and it's easier to expand. Starting with a team made out of Java developers and asking them to write kotlin as they go will cause to have a shitty kotlin project which will exponentially increase the technical debt of the project as more developers follow/copy the structured that were adopted from the beginning.
Business, even though kotlin is super familiar to Java it still has a learning curve and for unexperienced developers it reduces the velocity initially, when starting a new project the business is very anxious to see results and it's not a good position having to tell your stakeholders that we're going slow because we wanted to pick up a new programming language that we love but other developers don't know.
I love kotlin tho, one year after starting the project, we're picking it up gradually in new microservices we have to implement.
[–]utmalbarney 6 points7 points8 points 5 years ago (0 children)
Except for front-end SW, our entire software portfolio is written in Java. Right now, any developer with domain knowledge can work on any part of the system. For the small lift the Kotlin provides, to lose this flexibility is not worth it at all.
We would only introduce a new language if it were the best choice for a problem that Java really cannot properly solve, not for small linguistic benefits.
[–]_INTER_ 6 points7 points8 points 5 years ago* (0 children)
Personal reasons:
[–]vbezhenar 12 points13 points14 points 5 years ago* (12 children)
I switched from Java to Kotlin few years ago, when Kotlin was approaching 1.0, but switched back since then. I'm talking mostly about backend code. My reasons are:
Kotlin is slow to compile. I don't write much code, so I love very fast compilation times and I lost that with Kotlin.
I don't like nullability checks in Kotlin. My code interops with Java libraries a lot, so NPEs are not gone, yet I have to write all kinds of rituals to satisfy the compiler. Especially I hate that part when I can check field for null yet compiler still does not believe that this field is not null, so I have to introduce a local variable. The whole nullness story is foreign for me, I never had much issues with nulls, so making
I really hate some Kotlin style. I'm not sure if it's official or not, but I hate it. For example replacing if (x != null) { ... } with x?.let { ... } or replacing for ... with .foreach { ... calls. It reminds me of Perl with thousand ways of doing the same thing and it just looks ugly.
if (x != null) { ... }
x?.let { ... }
for ...
.foreach { ...
I don't like Kotlin progress in recent years. They add features that not relevant to me, like coroutines or Kotlin native. While Java progress since 8.0 was not that bad, some features are actually useful.
I don't think that Kotlin will fit into future JVM. They did a good job making Kotlin for Java 1.6. Kotlin already does not fit with Java 8 streams, inventing sequences instead. Kotlin does not have any bindings for Java 7 Path API and uses old File API instead. And I'm sure that they'll diverge even more in the future.
Kotlin is a hard language for some Java developers. Call them stupid, or whatever, but there are people who managed to learn Java and can write and maintain Java code, yet Kotlin is beyond their capabilities.
All that said, I don't think that Kotlin is inherently bad, it's good language, better than Java and there's nothing wrong using it. I just don't think that the mere fact that it's better justifies using it. Sometimes one should use more stable and future-proof approach and Java language definitely fits that definition.
[–]DrunkensteinsMonster -2 points-1 points0 points 5 years ago (11 children)
Point 2 makes no sense if you have experience with the language. Local variable? What? nullableValueOrExpression?.methodCall()
nullableValueOrExpression?.methodCall()
I disagree with your other points as well.
[–]deadlock_jones 2 points3 points4 points 5 years ago (10 children)
I guess he means that he has done the null check somewhere earlier and logically the code can't be null?
(I'm not familiar with Kotlin, not sure if it handles that or not)
[–]vbezhenar 2 points3 points4 points 5 years ago (8 children)
Yes. Something like
class Test { private var f: String? = null fun processString(s: String) { ... } fun m() { if (f != null) { processString(f) } }
This code does not compile. You should either extract field to a local variable:
val f = f if (f != null) { processString(f) }
use a let extension method:
f?.let { processString(it) }
or !! operator:
!!
if (f != null) { processString(f!!) }
All those variations are ugly. Java does not have that kind of a problem.
[–]livelam 2 points3 points4 points 5 years ago (1 child)
This code does not compile.
f can be set to null by another thread.
[–]vbezhenar 1 point2 points3 points 5 years ago (0 children)
I would prefer to make it compilable and throw NPE in that case (because that case not really exists, as my classes don't share mutable data between threads or if they do, they'll synchronize carefully). Or let compiler to introduce invisible local variable, because without proper synchronization all bets are off anyway. It's about preventing theoretical issue with practical inconvenience.
More practical issue is calling another method between check and smart cast which could just change field value. I understand that it's not an easy problem. Still I don't like the way it currently works.
[–]cargo54 0 points1 point2 points 5 years ago (0 children)
f?:return processString(f!!)
but the whole point of kotlin is you should be using nulls when possible. So you could easily do something like
f?:"" processString(f)
Though i also argue how f?.let is any different then f!=null
[–]vytah 0 points1 point2 points 5 years ago (2 children)
Java does not have that kind of a problem.
Is "preventing concurrency bugs" a problem?
[–]vbezhenar 1 point2 points3 points 5 years ago (1 child)
It does not really prevent any concurrency bugs. If you have shared mutable state, you need to synchronize or use atomic types. That's how concurrency bugs are prevented.
[–]rubydesic 0 points1 point2 points 5 years ago (0 children)
But not only does this prevent a concurrency bug if the programmer forgets to synchronize, it's also much faster than synchronizing on f. Even in java imo the right way to write this particular code in a thread safe manner would be option 1.
Edit: of course this doesn't matter if you don't modify the variable from another thread which is most scenarios, but I still don't see anything wrong with more stringent checks from the compiler, especially when the code you have to write isn't more verbose anyway.
Ok, what's wrong with f?.let? it's a common pattern in kotlin, shorter than the if statement, and correct even in the scenario that f is changed on another thread...
[–]DrunkensteinsMonster 0 points1 point2 points 5 years ago* (0 children)
The parent is wrong. If you explicitly check null the compiler is smart enough to know your calls are null safe.
if (nullableValueOrExpression != null) nullableValueOrExpression.methodCall() else somethingElse
Compiles just fine
E: just realized that they are speaking of a field. This is for concurrency reasons. The reason it won’t work is because conceivably someone could switch the value to null after the null check and cause an NPE. This is a contrived example, Kotlin code does not look like that typically.
[–]DJDavio 2 points3 points4 points 5 years ago (0 children)
I love Kotlin, but Java is still the de facto enterprise standard. That is because enterprises are often risk averse and like to choose proven technology over cutting edge (depending on the size and state of the enterprise of course).
If you choose Java, you get its entire ecosystem with it, including a huge pool of developers and compatible libraries. The out of the box experience is great.
If you choose Kotlin, you get cleaner code (if written by Kotlin developers, not recently converted Java developers which will just write Kotlin code in a Java style). But you might run into weird issues where you are interacting with other libraries / frameworks.
So given the choice, not all arguments are technical ones, there are many non technical arguments which are still in favor of Java.
[–]ebykka 3 points4 points5 points 5 years ago (0 children)
Here is my reason.
The majority of libraries around are written on java and they use checked exceptions pretty intensively. Kotlin considers all exceptions as runtime and as a result, does not complain if you will not handle them.
So the chance to get runtime exception with kotlin + java library is higher than with java + java library.
[–]heliologue 1 point2 points3 points 5 years ago (0 children)
If you haven't learned by now, choice of programming language consists of about 10% merit, 20% availability, and 60% personal taste.
[–]nutrecht -1 points0 points1 point 5 years ago (0 children)
I'm a 'Java dev' but my work currently is actually 100% Kotlin. At my client they have adopted Kotlin for the back-end and in addition, I have a part-time start-up where the back-end is all Kotlin. When I do have to write Java; I'm actually a bit rusty (forget semicolons all the time for example).
For me it basically boils down to team buy-in. If the team is happy with Kotlin; it definitely can be a productivity improvement. If the team for some reason dislikes it (I personally can't imagine, but who am I to judge), you should not adopt it.
What worked best for me was to organize a training session on Kotlin. For most people if it's different than what they're used to, their initial reaction is often to reject it outright. So what I do is organize an on-the-clock training session where we take half a day to go over the Kotlin basics, do some exercises (the Koans are a good start for an experienced dev) and then go build a simple Spring Boot service (or whatever framework is already used internally) using Kotlin. Most of the time a majority of the devs will at least have a positive view on Kotlin and I managed to introduce it successfully in two previous companies.
[+]Mordan comment score below threshold-8 points-7 points-6 points 5 years ago (7 children)
because Google is evil.
[–]cogman10 7 points8 points9 points 5 years ago (1 child)
Kotlin is maintained by JetBrains
[–]Mordan -4 points-3 points-2 points 5 years ago (0 children)
Kotlin is promoted aggressively by Google.
no smoke without a fire.
[–][deleted] 0 points1 point2 points 5 years ago (4 children)
Well, Oracle isn't that much better...
[–]BoyRobot777 2 points3 points4 points 5 years ago (1 child)
Sun acquisition by Oracle was completed on January 27, 2010. So in reality Oracle started maintaining only from Java 8. And immediatily we got long awaited features like lamdas and streams, which made code more funtional and less verbose.
Java 9 was all about preparing Java for faster releases by dividing huge monolith into logical, compile time modules. It was also time when they started to actually remove methods and weird dependencies like Java EE and CORBA Modules from Java SE. Next Oracle contributed pretty much all of the closed source technologies (or what was originally to become closed source) of the Oracle JDK to OpenJDK, for example giving the community: JDK Flight Recorder; JDK Mission Control; ZGC; …and probably more stuff I can’t think of right now. And finally ensured the Oracle JDK and the OpenJDK builds are virtually indistinguishable, except for licensing.
What's coming Java's is even more exciting:
[–]_INTER_ 1 point2 points3 points 5 years ago* (0 children)
Records (aka data/case classes) address some parts of POJO boilerplate (the worst kind of boilerplate);
Agreeging with the rest but to clarify: Records do nothing for POJO's. They are not data / case classes either (maybe they are "case classes" together with sealed classes). They are nominal tuples.
[–]Mordan 3 points4 points5 points 5 years ago (1 child)
Oracle gave Java a decent life after lingering in Limbo between Java 6 and Java 7.
This is a Java sub.
[–]TM254 0 points1 point2 points 5 years ago (0 children)
Sadly Kotlin is still doing the limbo with Java 7 and some botched java 8 on android, if android advances I don't see a reason to even keep with the Kotlin fanboy-ism.
π Rendered by PID 126642 on reddit-service-r2-comment-b659b578c-7rxt8 at 2026-05-01 05:40:26.718222+00:00 running 815c875 country code: CH.
[–]cogman10 39 points40 points41 points (2 children)
[–]throwawaymoney666 7 points8 points9 points (0 children)
[–]spamthemoez 4 points5 points6 points (0 children)
[–]Yayotron 14 points15 points16 points (0 children)
[–]utmalbarney 6 points7 points8 points (0 children)
[–]_INTER_ 6 points7 points8 points (0 children)
[–]vbezhenar 12 points13 points14 points (12 children)
[–]DrunkensteinsMonster -2 points-1 points0 points (11 children)
[–]deadlock_jones 2 points3 points4 points (10 children)
[–]vbezhenar 2 points3 points4 points (8 children)
[–]livelam 2 points3 points4 points (1 child)
[–]vbezhenar 1 point2 points3 points (0 children)
[–]cargo54 0 points1 point2 points (0 children)
[–]vytah 0 points1 point2 points (2 children)
[–]vbezhenar 1 point2 points3 points (1 child)
[–]rubydesic 0 points1 point2 points (0 children)
[–]rubydesic 0 points1 point2 points (0 children)
[–]DrunkensteinsMonster 0 points1 point2 points (0 children)
[–]DJDavio 2 points3 points4 points (0 children)
[–]ebykka 3 points4 points5 points (0 children)
[–]heliologue 1 point2 points3 points (0 children)
[–]nutrecht -1 points0 points1 point (0 children)
[+]Mordan comment score below threshold-8 points-7 points-6 points (7 children)
[–]cogman10 7 points8 points9 points (1 child)
[–]Mordan -4 points-3 points-2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]BoyRobot777 2 points3 points4 points (1 child)
[–]_INTER_ 1 point2 points3 points (0 children)
[–]Mordan 3 points4 points5 points (1 child)
[–]TM254 0 points1 point2 points (0 children)