Kotlin and Java both build Android apps, and they can share one project: Kotlin is “100% interoperable with the Java programming language”. For a new app, Google recommends Kotlin. Android development has been Kotlin-first since 2019, and Jetpack Compose, Android’s modern UI toolkit, works only in Kotlin. Java still works: Google’s Android Studio guide says it is “supported but not recommended for new projects”.
This guide follows the makers’ own pages, quoted and linked, as read on 10 November 2026: JetBrains’ Kotlin documentation, Google’s Android Developers site, and the pages of Oracle and the OpenJDK project for Java. It covers what each language has that the other lacks, where Google stands on Android, how the two call each other, how to move a Java app to Kotlin one file at a time, Java’s current releases, and where to learn.
What is the difference between Kotlin and Java?
Kotlin is a newer language from JetBrains that compiles to Java-compatible bytecode and changes several of Java’s rules: null is part of its type system, exceptions are never checked, and data classes, coroutines and extension functions are built in. JetBrains’ FAQ describes it as “an open-source statically typed programming language that targets the JVM, Android, JavaScript, Wasm, and Native”. The project “started in 2010”, and Kotlin 1.0 came out in February 2016.
Java comes from the OpenJDK project, which produces the “open-source reference implementations of the Java SE Platform” and “ships a feature release every six months”, and from Oracle, which builds and supports its own Java releases. The two meet in the bytecode: when it targets the JVM, “Kotlin produces Java-compatible bytecode”, so Kotlin code calls Java libraries and Java code calls Kotlin classes. On Android, both go through the same build, and Google’s page on Java versions in Android builds notes that “The JVM is not used on Android devices or emulators.”
Side by side, from JetBrains’ comparison and Google’s own table:
| Topic | Kotlin | Java |
|---|---|---|
| Made by | JetBrains | OpenJDK, Oracle |
| Latest release | 2.4.21 | JDK 27 |
| Null safety | Built in | No |
| Checked exceptions | No | Yes |
| Data holders | Data classes | Records |
| Coroutines | Yes | No |
| Extension functions | Yes | No |
| Ternary operator | if expression | a ? b : c |
| Android APIs | Yes | Yes |
| Jetpack Compose | Yes | No |
| Android samples | Yes | Best effort |
| Multiplatform | Yes | No |
Kotlin or Java for Android: which does Google recommend?
Google recommends Kotlin. Its Kotlin-first page says so in one sentence: “If you’re looking to build an Android app, we recommend starting with Kotlin to take advantage of its best-in-class features.” The position came in steps:
- 17 May 2017: Google announced that “we are officially adding support for the Kotlin programming language”, with the Kotlin plugin bundled in Android Studio 3.0.
- Google I/O 2019: Google said that Android development “will be increasingly Kotlin-first”.
- Today: in Android Studio, “Kotlin is now the default language choice” for new projects.
Google also co-founded the Kotlin Foundation. Here is what Kotlin-first means, in its words:
When building new Android development tools and content, such as Jetpack libraries, samples, documentation, and training content, we will design them with Kotlin users in mind while continuing to provide support for using our APIs from the Java programming language.
The same page has a table that sorts what each language gets:
- Both: the platform SDK, Android Studio, Lint, guided docs, API docs and AndroidX libraries.
- Best effort for Java: online training and samples.
- Kotlin only: AndroidX’s Kotlin-specific APIs such as KTX and coroutines, multiplatform projects, Jetpack Compose, and compiler plugins through the Kotlin Symbol Processing API, which “was created by Google to develop lightweight compiler plugins.”
For a new app, Compose is the deciding point. Google’s page on Kotlin for Jetpack Compose opens with “Jetpack Compose is built around Kotlin”, and warns that if you think in another language and “mentally translate that language to Kotlin, you’re likely to miss out on some of the strength of Compose”. Android Studio’s guide to creating a project adds that Kotlin “is required for modern frameworks like Jetpack Compose.” Google uses Kotlin itself: over 70 of its apps, including Maps, Home, Play, Drive and Messages, “are built using Kotlin”.
Is Kotlin better than Java?
For Android, Google and JetBrains both argue for Kotlin, mainly for safer and shorter code. The figures they publish:
- Fewer crashes: Google says “Android apps that contain Kotlin code are 20% less likely to crash.” When its Google Home team moved new feature development to Kotlin, the codebase shrank by 33% and crashes from null pointer exceptions fell by 30%.
- Less code: JetBrains’ FAQ gives rough estimates of “approximately a 40% cut in the number of lines of code.”
- Productivity: “67% of professional developers who use Kotlin say Kotlin has increased their productivity.”
On speed, Google’s FAQ answers in one sentence:
Kotlin doesn’t have a direct performance impact, but just as with the Java language, you should be thoughtful about how you use it.
Its two examples: copying between new collection instances again and again can weigh on garbage collection, and a method that accepts non-null types adds a method call for the null check.
Kotlin has costs too. Google’s guide to adopting Kotlin notes that “In Kotlin, classes and their functions are closed for extension by default”, which gets in the way of mocking frameworks such as Mockito, and that Java code without nullability annotations reaches Kotlin as platform types, which “can lead to runtime NullPointerException issues.” Java also keeps features that Kotlin left out, listed in the next section. In practice, you can write new code in Kotlin and keep the Java that already works, in the same app.
Java vs Kotlin: what does each have that the other doesn’t?
Kotlin has null safety, data classes, coroutines and extension functions that Java lacks, and Java keeps checked exceptions, primitive types, static members, the ternary operator, records and package-private visibility. That is the split in JetBrains’ Comparison to Java, updated on 14 October 2026. The page opens with “Kotlin fixes a series of issues that Java suffers from”, among them:
- “Null references are controlled by the type system.”
- “No raw types”, and “Arrays in Kotlin are invariant”.
- Proper function types, “as opposed to Java’s SAM-conversions”.
- “Separate interfaces for read-only and mutable collections”.
What Java has that Kotlin does not, on the same page:
- Checked exceptions, which JetBrains counts among the issues Kotlin fixes.
- Primitive types that are not classes: “The byte-code uses primitives where possible, but they are not explicitly available.”
- Static members, which Kotlin replaces with “companion objects, top-level functions, extension functions, or @JvmStatic.”
- Wildcard types, replaced by declaration-site variance and type projections.
- The ternary operator,
a ? b : c, which “is replaced with if expression.” - Records and the package-private visibility modifier.
- Pattern matching, where Kotlin’s smart casts “provide similar functionality to pattern Matching in Java.”
Beyond null safety, data classes, coroutines and extension functions, the page’s list of what Kotlin has includes string templates, properties, primary constructors, top-level functions, default and named parameters, operator overloading, and expect and actual declarations for multiplatform code. Java has closed part of the gap: the page credits Java 10 with local-variable type inference, and says Java’s pattern matching gives similar functionality to Kotlin’s smart casts.
How do null safety, coroutines and data classes work in Kotlin?
Null safety puts null into the type system, coroutines run long tasks without blocking a thread, and data classes generate the code a Java class spells out by hand. Two more features change everyday code for a Java developer: extension functions, and exceptions that are never checked.
Null safety. Kotlin’s documentation sums it up:
Kotlin explicitly supports nullability as part of its type system, meaning you can explicitly declare which variables or properties are allowed to be null. Also, when you declare non-null variables, the compiler enforces that these variables cannot hold a null value, preventing an NPE.
A String can’t hold null; a String? can, and the compiler makes you handle that case before you use it. JetBrains lists the only ways left to get a NullPointerException: an explicit throw, the not-null assertion operator !!, some mistakes during initialization, and code that comes from Java. On Android’s side, since Android 9 (API level 28), “the Android SDK contains nullability annotations”, so annotated Android APIs reach Kotlin as nullable or non-null types.
Coroutines. In JetBrains’ words, “Coroutines are lightweight alternatives to threads” that “suspend without blocking system resources”. A function marked suspend can pause and resume, and builders such as launch() and async() from the kotlinx.coroutines library start new coroutines. They arrived in Kotlin 1.3, and Google’s guide to coroutines on Android is direct: “Coroutines is our recommended solution for asynchronous programming on Android.”
Data classes. “Data classes in Kotlin are primarily used to hold data.” For each one, the compiler writes equals() and hashCode(), toString(), copy() and componentN() functions from the properties of its primary constructor. Google’s adoption guide replaces a Java Person class, with its getters, setters, equals(), hashCode() and toString(), with “a single line of Kotlin”: data class Person(var firstName: String?, var lastName: String?). Java’s answer is the record, a class “for storing immutable data”, and JetBrains’ page on Java records notes that “Records are very similar to Kotlin data classes.”
Extension functions. “Kotlin extensions let you extend a class or an interface with new functionality without using inheritance or design patterns like Decorator.” An extension leaves the class unchanged and makes a new function callable on it with the usual dot syntax, chosen from the declared type at compile time. Android KTX is built on them: “a set of Kotlin extensions that are included with Android Jetpack and other Android libraries.”
Checked exceptions. Java makes you catch or declare checked exceptions such as IOException; Kotlin does not, since “Kotlin treats all exceptions as unchecked by default.” You can still catch them when you want. When Java code must catch an exception thrown by a Kotlin function, mark the function with @Throws, or the Java compiler rejects the catch.
Can Kotlin and Java work together in one app?
Yes, in the same module and even the same folder: new Kotlin files go in src/main/java/ by default, next to the Java ones. Google’s Kotlin on Android FAQ answers the choice between the two languages with “You don’t have to pick! You can use both.” JetBrains built Kotlin for it:
Kotlin is designed with Java interoperability in mind. Existing Java code can be called from Kotlin in a natural way, and Kotlin code can be used from Java rather smoothly as well.
Calling Java from Kotlin. “Pretty much all Java code can be used without any issues”. Java getters and setters show up as Kotlin properties, so calendar.getFirstDayOfWeek() reads calendar.firstDayOfWeek. The catch is null, since “Any reference in Java may be null”: Kotlin gives Java values platform types and relaxes its null checks on them, so a null can still fail at runtime. Nullability annotations fix that, and Kotlin reads several kinds, including JetBrains’, JSpecify’s and Android’s.
Calling Kotlin from Java. A Kotlin property compiles to a getter and, for a var, a setter. Functions at the top level of a file named app.kt become static methods of a Java class named AppKt, which @JvmName can rename. A function with default parameter values is visible in Java “only as a full signature, with all parameters present”, unless you add @JvmOverloads. And since Java can pass null anywhere, “Kotlin generates runtime checks for all public functions that expect non-nulls”.
Google’s Kotlin-Java interop guide turns this into rules for code that both languages call. One of them, for Java authors: “Every non-primitive parameter, return, and field type in a public API should have a nullability annotation.”
How do you migrate a Java app to Kotlin?
One file at a time. Android Studio adds Kotlin to a Java project and converts Java files for you, and Google’s guide for teams opens with this advice:
Moving to a new language can be challenging. To set your team up for success, start slow, migrate in small chunks, and test frequently. Kotlin compiles to JVM bytecode and it’s fully interoperable with Java, which makes migration easier.
The steps, from Google’s page on how to add Kotlin to an existing app:
- Add Kotlin to the project. Choose File › New › Kotlin File/Class, or any Android template with Kotlin as its source language. The first time, Android Studio warns that Kotlin isn’t configured: click Configure, and choose all modules containing Kotlin files.
- Convert a Java file. Open it and choose Code › Convert Java File to Kotlin File, or paste Java code into a Kotlin file and accept the conversion.
- Review the result. The converter writes Kotlin “that compiles and runs”, but Google adds that “it’s likely that you need to make additional optimizations to the converted code.” A common case: a view assigned after construction comes out nullable and unwrapped with
!!, wherelateinitfits better. - Run your tests. Google’s FAQ asks you to “ensure that your tests continue to pass”.
Where to start, in Google’s order:
- One app, not your flagship. Google suggests a single app in your organization for the first move.
- Data model classes, which hold mostly state, one at a time, each tested against your current suite.
- Tests, converted or newly written in Kotlin, before any code that ships.
- Utility classes, turned into extension functions, with
@file:JvmName("StringUtils")at the top of the file so Java callers keep callingStringUtils.foo(). - Then the larger parts: fragments, activities, ViewModel objects and business logic.
Plan for your tests’ mocks: Kotlin classes are final unless you open them, so Google suggests Mockito’s inline mock maker, or the All-Open compiler plugin, which works for both unit and instrumented tests.
Is Java still used for Android?
Yes. Google still supports Java for Android’s platform APIs, in Android Studio and in AndroidX, and many developers still write it. JetBrains’ page on Kotlin for Android, dated 9 December 2025, puts figures on it: “Over 50% of professional Android developers use Kotlin as their primary language, while only 30% use Java as their main language.”
What changed is where Google puts new work: Java gets best-effort training and samples, and no Compose. And Java on Android has its own ceiling, since Android does not follow the newest JDK: “Each version of Android supports a specific version of the JDK and a subset of its available Java APIs.” In Google’s table, updated on 28 October 2026, Android 14 (API level 34) supports Java 17, and Android 12 and 13 support Java 11. A newer Java API can sometimes reach older Android versions “through a process known as desugaring”. Some Java language features “require library support and are not available on Android”, while others, “such as switch expressions, only require the Java compiler and work on Android.”
Java also stays in every Android build, Kotlin or not: Android Studio and Gradle run on a JDK, and Android Studio comes with its own, the JetBrains Runtime. Google recommends that you “always specify the Java toolchain”, a setting that “works if your source is Kotlin, Java, or a mix of both.”
What is the latest version of Java, and how long is it supported?
JDK 27 is the latest Java release: it “reached General Availability on 15 September 2026”, according to its OpenJDK page. The current long-term support (LTS) release is Java 25, from September 2025, with Oracle’s Premier Support until September 2030. JDK 28 is in development, scheduled for general availability on 9 March 2027.
Oracle’s support roadmap, updated on 20 October 2026, names the LTS releases:
Java SE 8, 11, 17, 21, and 25 are LTS releases. Oracle intends to make future LTS releases every two years meaning the next planned LTS release is Java 29 in September 2027.
Its dates apply to Oracle’s commercial support:
- Java 25 (LTS): Premier Support until September 2030, Extended Support until September 2033.
- Java 21 (LTS): Premier Support until September 2028.
- Java 17 (LTS): Premier Support ended in September 2026; Extended Support runs until September 2029.
- Java 27: Premier Support until March 2027, when Java 28 replaces it.
Free builds exist: Oracle provides “OpenJDK releases under a free open source license”, and since September 2025, Oracle JDK 25 itself comes under a free use license for all users.
Kotlin’s rhythm is close, with a language release every six months. The current version is 2.4.21, published on 8 October 2026, and 2.5.0 is planned for December 2026. Since Kotlin 2.4.0, each release line of the standard library for the JVM gets an 18-month window for security fixes. For your Android app’s own code, what counts is the Java version Android supports, from Google’s list in the previous section.
Should I learn Kotlin or Java?
For Android, learn Kotlin: Google’s recommended course for beginners teaches Android in Kotlin, and Google’s advice for a new Android app is to start with it. Java stays useful to read, since Kotlin calls Java libraries directly.
Google’s Training courses page calls Android Basics with Compose “the recommended course to start learning Android!” You build its apps in Kotlin with Jetpack Compose, and “No programming experience required.” The course has eight units. The first, Your first Android app, takes 10 hours by Google’s estimate, three of them on Kotlin itself, and you need basic computer and math skills and a computer that can run Android Studio. When Google released its first units on 2 May 2022, it called it “the first free course that teaches Android development with Jetpack Compose to everyone.” Google’s training page also lists two intermediate courses: Jetpack Compose for Android developers, and Basics of Kotlin Multiplatform.
JetBrains’ own entry point is its Kotlin tour: “These tours can be completed entirely within your browser. There is no installation required.” Then our guide to Android app development takes you from installing Android Studio to a first project and a signed release, and the one on how to make an app covers the path on both stores.
If you already write Java, JetBrains says Kotlin “is very easy to learn, especially for Java developers”, and its FAQ expects people to be “reading and writing Kotlin in a matter of days”, with idiomatic Kotlin taking “a little longer”. Google’s Kotlin and Android page has a section for Java developers, with its interop guides. Outside Android, Kotlin runs on servers too: JetBrains’ FAQ says it works with existing Java frameworks “such as Spring Boot, vert.x, or JSF”.
What is Kotlin Multiplatform, and can it share code with iOS?
Kotlin Multiplatform shares Kotlin code between Android, iOS and other platforms, and Java has no counterpart in Google’s comparison table. JetBrains describes it:
Kotlin Multiplatform (KMP) is an open-source technology from JetBrains that enables sharing code across Android, iOS, desktop, web, and server while retaining the advantages of native development.
You decide how much to share: isolated modules such as networking or storage, all of the business logic while each app keeps its own interface, or the interface too, with Compose Multiplatform. On iOS, the interface can stay in SwiftUI or UIKit. JetBrains rates both the core technology and Compose Multiplatform as Stable on Android and iOS. Google’s Kotlin Multiplatform page says KMP is “officially supported by Google for sharing business logic between Android and iOS”, and lists Jetpack libraries that already support it, among them Room, DataStore, ViewModel and Paging.
The iOS app still needs Apple’s tools. JetBrains’ quickstart says: “To create iOS applications, you need a macOS machine with Xcode installed.” Xcode 27.2, the current release, needs macOS Tahoe 26.6 or later, according to Apple’s requirements page. If your computer runs Windows, our guide to Xcode for Windows covers what you can do from there.
What to do
- Start a new Android app in Kotlin, with Jetpack Compose and the Empty Activity template.
- New to code: take Android Basics with Compose, Google’s free course, then build a first app with our guide to Android app development.
- Keep a working Java app running: add Kotlin files next to the Java ones, and convert one class at a time, data models and tests first.
- Review every converted file, replace
!!withlateinitor a null check where it fits, and keep your tests passing. - Annotate nullability in the Java code that Kotlin calls, and add
@Throws,@JvmNameor@JvmOverloadswhere Java calls Kotlin. - Set the Java toolchain in your build, whichever language you write.
- To share code with iOS, start with the business logic in Kotlin Multiplatform, and plan for a computer running macOS with Xcode.
- Publish through Google Play Console: an account costs US$25 once, and new apps and updates must target Android 16 (API level 36) or higher, with lower levels for Wear OS, Android Automotive OS, Android TV and Android XR. Our guide to Google Play Console covers the rest.
Sources
- JetBrains, Kotlin Documentation, Comparison to Java: what Kotlin fixes, what Java has that Kotlin does not, and the reverse.
- JetBrains, Kotlin Documentation, FAQ: what Kotlin is, its start and 1.0, the current version, bytecode, learning time, server frameworks.
- JetBrains, Kotlin Documentation, Kotlin release process: language releases, Kotlin 2.5.0, the standard library’s support window.
- JetBrains, Kotlin Documentation, Kotlin for Android: primary languages of Android developers, learning from Java.
- JetBrains, Kotlin Documentation, Calling Java from Kotlin: getters and setters, platform types, nullability annotations, checked exceptions.
- JetBrains, Kotlin Documentation, Calling Kotlin from Java: properties, top-level functions, @JvmName, @JvmOverloads, @Throws, null checks.
- JetBrains, Kotlin Documentation, Using Java records in Kotlin: records compared with data classes.
- JetBrains, Kotlin Documentation, Null safety: nullable types and the causes of an NPE.
- JetBrains, Kotlin Documentation, Coroutines: suspending functions and builders.
- JetBrains, Kotlin Documentation, Data classes: the generated functions.
- JetBrains, Kotlin Documentation, Extensions: extension functions and static resolution.
- JetBrains, Kotlin Documentation, Exception and error handling: unchecked exceptions, @Throws.
- JetBrains, Kotlin Documentation, Welcome to our tour of Kotlin!: the tours in the browser.
- JetBrains, Kotlin Multiplatform Documentation, What is Kotlin Multiplatform: what KMP shares.
- JetBrains, Kotlin Multiplatform Documentation, Stability of supported platforms: Android and iOS stable.
- JetBrains, Kotlin Multiplatform Documentation, Kotlin Multiplatform quickstart: Xcode for iOS apps.
- Google, Android Developers, Android’s Kotlin-first approach: the recommendation, what Kotlin-first means, Java compared, Google’s own apps.
- Google, Android Developers, Kotlin and Android: nullability annotations since Android 9, resources for Java developers.
- Google, Android Developers, Kotlin on Android FAQ: using both, the default language, converting code, performance.
- Google, Android Developers, Create a project: Kotlin recommended, Java not recommended for new projects.
- Google, Android Developers, Kotlin for Jetpack Compose: Compose built around Kotlin.
- Google, Android Developers, Kotlin-Java interop guide: rules for APIs both languages call.
- Google, Android Developers, Add Kotlin to an existing app: adding Kotlin, converting files, nullability after conversion.
- Google, Android Developers, Adopt Kotlin for large teams: where to start, the traps.
- Google, Android Developers, Kotlin coroutines on Android: coroutines recommended, Kotlin 1.3.
- Google, Android Developers, Android KTX: Kotlin extensions in Jetpack.
- Google, Android Developers, Java versions in Android builds: the JDK in a build, Java per Android version, desugaring, the toolchain.
- Google, Android Developers, Kotlin Multiplatform: Google’s support, Jetpack libraries for KMP.
- Google, Android Developers, Training courses: the recommended course, intermediate courses.
- Google, Android Developers, Android Basics with Compose course: units, durations, prerequisites.
- Google, Android Developers Blog, Android Announces Support for Kotlin: 17 May 2017.
- Google, Android Developers Blog, Learn Android with Jetpack Compose (no programming experience needed!): the free course, 2 May 2022.
- Google, Play Console Help, Get started with Play Console: the US$25 registration fee.
- Google, Play Console Help, Target API level requirements for Google Play apps: Android 16 since 31 August 2026.
- OpenJDK, JDK Project: releases every six months.
- OpenJDK, JDK 27: general availability on 15 September 2026.
- OpenJDK, JDK 28: the schedule.
- Oracle, Oracle Java SE Support Roadmap: LTS releases, support dates, licenses.
- Apple, Apple Developer, SDK and system requirements: Xcode 27.2 and the macOS it needs.
Checked on 10 November 2026.