- On Google Services
Your words, your language, anywhere
Available for google services, chrome, android devices, and windows..
Watch the video
Online, offline, on the go
Whether at home, at work, or somewhere in between—communicate in the language you need, when you need it.
Personalized for you, by you
Google Input Tools remembers your corrections and maintains a custom dictionary for new or uncommon words and names.
Type the way you want
Get your message across in the language and style you want. Switching among over 80 languages and input methods is as seamless as typing.
Input methods in other languages:
- Supported languages
- Content attribution
Let us know what you think – submit feedback .
- About Google
How to Add and Manage Dictionaries on Chrome
Even if you're speaking in your native tongue, there is always going to be a word you'll need to look up. Since Google is aware of this, Chrome allows you to add dictionaries for your word-searching needs. The browser already has a default dictionary when it's first installed to help with the default language.
The good news is that Chrome allows you to add more languages and words to the dictionaries. The process may sound simple, but sometimes it can be frustrating if you're not sure where you need to click to add those extra language packs.
How to Add Dictionaries to Google Chrome
To add another dictionary to Chrome, you'll need to go to Settings and scroll all the way until you find "Advanced Settings." Click on this last option, and more options will appear. Under languages you'll see the language and spellcheck options. Click on the Language drop-down menu to the right, and you should see the "Add languages" option in Blue.
Click on it and either have the option to find a particular language by using the search option at the top or by scrolling down until you find it. When you see the language, you want to click on the empty box to the left of it and click on add. Don't forget that you can also use the sidebar to go through all the language options.
After selecting a language, you will see a relaunch button appear. You won't see Chrome in the new language without relaunching the browser first. Just in case you forget what language you choose to have Chrome be shown in, Google will let you know by showing you an option that says, "Google Chrome is displayed in this language" in green.
How to Manage Google Chrome Dictionaries
Once you've added all the dictionaries you want, it's time to know how to manage them. In the Languages section of Settings, you'll see three vertical dots that will help you control your newly added languages.
If you decide to go with a different one, click on the dots and choose "Display Google Chrome in this language," "Offer to translate pages in this language," "Move to the top," "Move Up," and "Remove."
By right-clicking on a word when you're typing, you can also modify your Chrome dictionary. Move the cursor over Spellcheck, and a side menu will appear to the right.
Here you can either change languages or go into language settings to do everything previously mentioned. You can even ask Google for help by choosing the "Ask Google for suggestions" option.
When you click on this option, Google will show you a message for you to enable it. Click on the blue "Enable" button, and it will be turned on automatically. To turn it off, follow the same steps and click on the option again to turn it off.
Dictionaries can help you avoid some really embarrassing situations by using the wrong word. You can also prevent those shaming mistakes in other languages by adding as many language packs as you need. As you can see, managing Chrome's default dictionary is also very easy.
Just a simple guy that can't enough of Technology in general and is always surrounded by at least one Android and iOS device. I'm a Pizza addict as well.
Our latest tutorials delivered straight to your inbox
How to change the language on google.
Make every Google app speak your language!
Set google services to a different language on desktop, make google services use another language on mobile.
Google makes its services available in many different languages in addition to English. If you'd like to use Gmail, Drive, and other services in your chosen language, simply set the new language as the default in your account. We'll show you how to do that on your desktop and your mobile.
Later, if you want, you can switch back to English for all your Google services.
If you're on a Windows, Mac, Linux, or Chromebook computer, use a website in your browser to change your language.
Start by opening a web browser of your choice on your computer and launching the Google Account site. On the site, log in to your Google account. It's easy to recover your Google password if you've forgotten it.
After you've logged in, from the sidebar on the left, select "Personal Info."
Scroll down the page to the "General Preferences for the Web" section. Here, click "Language."
On the "Language" page, next to the language listed under "Preferred Language," click the pencil icon.
Later, to go back to the default language, click the up-arrow icon next to your language in the "Other Languages" section.
An "Add Language" window will open. Here, find and select your new language. Then click "Select."
Close your web browser, reopen it, and visit a Google service like Drive . You'll see that it now uses the newly-specified language in your account.
You're all set.
To change Google's language on your iPhone, iPad, or Android phone, use the free Gmail app.
Start by launching Gmail on your phone. In the app's top-right corner, tap your profile picture or your initials (depending on what you've added to your account).
From the menu that opens, select "Manage Your Google Account."
On the page that opens, in the tab list at the top, choose "Personal Info."
Scroll down the page to the "General Preferences for the Web" section. Then tap "Language."
On the "Language" screen, next to your default language, tap the pencil icon.
In the future, to revert back to your original language, select the up-arrow icon next to your language on the page.
You'll see an "Add Language" page. Here, find and tap your new language. Then tap "Select."
And that's it. Google will now use your newly-selected language for all the Google services you use.
If you want, in addition to Google, you can change the default language on Chrome , Tor , Windows 10 and Windows 11 , Amazon , Facebook , iPhone , and even Mac .
Related: How to Change Your Language Settings on Facebook
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Google Chrome Dictionary Location
I'm trying to find the dictionary file for Google Chrome on OS X - I'd like to remove certain words from the dictionary so that I don't use them when writing email (such as 'foolish' for example).
In Firefox, this was a simply a matter of editing the dictionary file, but I'm not sure were I would find it in Chrome?
6 Answers 6
It doesn't appear that there is a user-editable file with the default dictionary in it. I just looked through the .app folder and saw nothing like a dictionary. Also, ~/Library/Application\ Support/Google/Chrome/Dictionaries/ doesn't list any dictionaries.
The file for the custom dictionary is:
You may also find it at:
In the comments, it's mentioned that you can find “misclicks” here, too, which is related to how OS X handles its dictionary:
Windows XP and Windows 7/Vista
It appears it's in (for Windows XP and Vista/7, respectively):
The location depends on whether you're running Chromium or Google Chrome
Chrome : ~/.config/google-chrome/Default/Custom Dictionary.txt
Chromium : ~/.config/chromium/Default/Custom Dictionary.txt
If you are using a non-default profile, instead of the directory named Default , check for a directory named Profile n where n is a number starting from 1.
- 2 In my case, it is in ...\Chrome\User Data`Default`\Custom Dictionary.txt – ROMANIA_engineer Nov 19, 2014 at 14:36
- I am adding this because I misread the previous statement as a folder name User Data Default instead of two folders User Data\Default C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\Custom Dictionary.txt. This is in Windows 7 and using Chrome 44.0.2403.125. – JabberwockyDecompiler Aug 4, 2015 at 15:01
- I second @helpYou. Perhaps it changed for Yosemite or other new versions of OS X? It's worth a +1 if anyone figures that out. – intcreator Aug 23, 2015 at 0:53
- Maybe you know where is this dictionary at Linux? – Vitaly Zdanevich Feb 10, 2016 at 11:18
- @VitalyZdanevich Probably ~/.config/google-chrome/Custom Dictionary.txt . Please confirm if that's where it is. – slhck Feb 10, 2016 at 12:27
For future reference, I found it under:
OSX Lion 10.7.4 Chrome 19.0.1084.56 June 2012
- Still in the Chrome/Default/ folder on nearly four years later on Yosemite. :) – Zlatty Mar 15, 2016 at 15:18
- 1 Works on El Capitan too. – WilliamKF Apr 28, 2016 at 1:40
- 2 Also you may want to correct it in: ~/Library/Spelling/LocalDictionary too – WilliamKF Aug 22, 2016 at 0:49
Add a new word to the dictionary
If the spell-checker keeps underlining a word that you often use, right-click the word and select Add to dictionary .
Windows, Chrome OS, and Linux only: Words that you choose to add to the dictionary are added to your "Custom spelling dictionary".
Edit your Custom spelling dictionary
Click the Chrome menu on the browser toolbar.
Select Settings .
Click Show advanced settings .
In the "Languages" section, click Languages and input settings .
Click Custom spelling dictionary .
In the open text field, type the new word that you want to add. To remove a word that you've previously added, hover over the word and click X .
Click Done .
Source: https://support.google.com/chrome/answer/95604?hl=en Checked: October 4, 2014. Rechecked May 26, 2015.
- 1 This process has changed in 2023 with Chrome 108+. Instead it's Settings > Languages > Customize Spell Check (at the bottom) – DeadChex Jan 9 at 19:59
- I'm on Chrome 118 and both options appear to work. – mbourgon Oct 23 at 19:55
This accepted answer is incorrect or out-of-date w/r/t Google Chrome on Windows. This is where Google Chrome version "31.0.1650.63 m" actually stores the custom dictionary:
\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\Custom Dictionary.txt
It's just a text file, with LF-only line terminations, and a list of words in case-sensitive alphabetical order, one per line. There's a checksum at the end, with no LF at the end of that line.
There's also a backup version, in the same folder, named "Custom Dictionary.txt.backup".
According to this https://chromiumcodereview.appspot.com/11414282 if the checksum fails to match in the regular version of the Custom Dictionary, and there's a backup version with a correct checksum, Chrome will silently discard the regular version and revert to the backup version.
Maybe that's be why Chrome keeps losing my custom dictionary words. :-(
So I think if you want to edit the custom dictionary file (e.g., to remove misspelled words), you'll need to delete the backup version, to prevent Chrome from reverting to it. (Note: I've not actually done this.)
- 1 I checked and this answer is correct. FYI, when I opened the files (in notepad++) I discovered that each line appears twice - I do not know why. The last line in my case with the checksum, looks like this: checksum_v1 = d9d0767ba5ff29b6c0f1862e88a0d646 – yosh m Nov 12, 2014 at 8:50
- This answer is now incorrect. – slm Jul 15, 2016 at 2:24
- What is incorrect, slm? I just checked, and on my computer the dictionary is still: \Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\Custom Dictionary.txt – Dave Burton Jul 16, 2016 at 5:44
- There's two backup files in my folder, there's a .backup and a .bak. Perhaps the file name was changed between 2020/9/2 and 2020/11/21? – Denise Skidmore Sep 13, 2021 at 14:51
- Denise, I still have only "Custom Dictionary.txt" and "Custom Dictionary.txt.backup" (dated 10/31/2021 and 10/30/2021, respectively), in my %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\ folder. – Dave Burton Nov 12, 2021 at 10:00
The actual dictionary is baked into the browser when it is compiled, so you can't normally find or edit it without re-compiling Chrome yourself. That said, there are a bunch of dictionaries, and they're all listed here:
- 1 I don't understand why this answer received a downvote: my dictionary file is located at %LOCALAPPDATA%\Google\chrome\Application\Dictionaries\en-US-8-0.bdic . The convert_dict tool would be required to create a new binary .bdic file with words removed. Custom Dictionary.txt seems to only support adding words. – davidmneedham May 6, 2019 at 20:22
- 1 As of May 2020, in Windows the folder is %LOCALAPPDATA%\Google\Chrome\User Data . The binary dictionary files I found were en-US-9-0.bdic and en-US-8-0.bdic – Leone May 23, 2020 at 19:47
Location of Custom Dictionary.txt on MAC has changed yet again. This is due to the fact that Chrome now supports multiple user profiles.
Profile 1 will change based on which account is used.
- Browser: Chrome 49
- OS: Mac OS X El Captan 10.11.2
You must log in to answer this question.
Not the answer you're looking for browse other questions tagged google-chrome dictionary ..
- The Overflow Blog
- Edge and beyond: How to meet the increasing demand for memory sponsored post
- AI is only as good as the data: Q&A with Satish Jayanthi of Coalesce
- Featured on Meta
- Changes to MSE deployment process may cause intermittent issues on November...
- Update: New Colors Launched
Hot Network Questions
- Restricted Meta-Cat
- According to pro-Palestinian sources, does Hamas indeed embed itself into civilian areas (to complicate IDF operations)?
- Filter Across Multiple Row Labels in Pivot Table
- CGPA Calculator in C++
- Who invented file extensions in file names?
- Why are systems with clustered eigenvalues easy to solve?
- How to produce a Calder mobile?
- Does a diode flyback protection decrease the life of the relay?
- Is the requirement to accept refugees unconditional in international law, even in the case of a forced population transfer?
- Is it illegal to warm up your car?
- Why notes played on bass strings on the highest frets sound bad?
- Best practices for seeking mentoring feedback from my PhD students
- Can a 25 amp breaker be used on #12 wire to feed a fridge receptacle?
- Representing binary functions with a finite gate set without exponential blow-up?
- Science fiction TV episode in which three young women meet a dying alien
- More stable algorithm to calculate `sqrt(a^2 + b^2) - abs(a)` in MatLab
- Who is the 'pale Titan-woman' in Swinburne's 'Ave atque Vale'?
- Can two songs share the same melodic notes but still have distinct melodies?
- What stat would I use for a crossbow if I throw it rather than shooting it?
- Is there any merit in the argument "this data processing is required for my business model so it is strictly necessary in terms of data protection"?
- how to output the τεχνική symbol
- Prove that in an n*(n+1) table filled with integers, we can always cross out some columns and make the sum of the integers in each row, even
- Why were slings phased out of medieval armies in favor of bows?
- Time for a new tyre?
- Google home
- Send feedback
- Privacy and terms
- Switch to full site
Google Dictionary (by Google)
- The Oxford English Dictionary
- OED Researchers Advisory Group
- The OED Community
- Research sub
- Language Datasets
- Indian Language Datasets
- Oxford Dictionaries API
- Dictionary Solutions
- Pronunciations Data
- Educational Assessment Platforms
- Assisted Writing Solutions
- Gamified Learning
- Semantic English Language Database
- Partners: Interview with Language Confidence
- Dictionaries for your products
- Dictionary Apps
- Oxford Dictionaries Premium
- For English Learners
- For Children
- Creating Content
- Word of the Year
- Branding resources
- Annual Updates
- Case Studies
- Our dictionary data
Oxford Languages and Google
Google’s English dictionary is provided by Oxford Languages.
Oxford Languages is the world’s leading dictionary publisher, with over 150 years of experience creating and delivering authoritative dictionaries globally in more than 50 languages.
What is included in this English dictionary?
How do we create our dictionaries, why do we include vulgar and offensive words in our dictionaries, why do we include slang and regional dialects in our dictionaries, how do we source our example sentences.
Find out how Oxford Languages is responding to user feedback ⟶
If you would like to get in touch about a specific dictionary entry, please complete the form below.
Top Contributors in Word: Stefan Blom - Suzanne S. Barnhill - Charles Kenyon - Bob Jones AKA: CyberTaz - Doug Robbins - MVP Office Apps & Services (Word) 👏 👏
October 9, 2023
Top Contributors in Word:
Stefan Blom - Suzanne S. Barnhill - Charles Kenyon - Bob Jones AKA: CyberTaz - Doug Robbins - MVP Office Apps & Services (Word) 👏 👏
- Search the community and support articles
- Microsoft 365 and Office
- Search Community member
Ask a new question
How can I change the default dictionary to English (UK)?
This has been driving me crazy for ages.
The way I fixed it was, I went in to EDIT then SELECT ALL so that all text in the document is highlighted. Then went in to TOOLS then LANGUAGE and chose ENGLISH UK, clicked DEFAULT, OK then saved and exited the program.
The existing document and all new ones are now in my chosen English UK format :)
77 people found this reply helpful
Was this reply helpful? Yes No
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
Thanks for your feedback.
A few points offered for clarification :-)
- Language is a formatting attribute in Office documents.
- The Language specified in Tools> Language detrermines the default language for that user in that installation of Office. That default applies only to new documents created using that installation of the software.
- Text that should deviate from the creator's default needs to be marked accordingly, either by selecting the text & using Tools> Language to specify the Language, or preferably by applying a Style which includes the appropriate Language attribute.
- The language formatting of the text in a document travels with the document, just as does bold, italic, indentation, etc. What default settings are used by another recipient of the document have no effect on document's language formatting.
- "Spelling settings" are irrelevant. The spell checking mechanism switches on the fly & uses any of the installed dictionaries needed based on the language formatting of the text in the document. I.e., if some of the text is marked as French the French dictionary will be used. If some of the text is in Spanish, the Spanish dictionary will be used. If other text is marked as US English, that dictionary will be used for it.
For more detailed information please have a look at this web page:
As for the question concerning point 6, Yes it does :-) If text is selected when the Default is changed that text will be reformatted accordingly. And, as described above, any new [future]documents that user creates will be formatted based on that default. The statement doesn't mean that existing document opened in the future will be automatically reformatted.
26 people found this reply helpful
- Norsk Bokmål
- Main content
How to change the language in Google Docs to translate a document or type in a different language
- You can easily change the language on Google Docs and select from one of the more than 100 languages included across the various Google apps.
- Changing the language in Google Docs can be useful for translating documents in another language.
- You can also change your typing language in Google Docs .
- Visit Business Insider's homepage for more stories.
While most of us usually only read and write documents in one language, there may be occasions in which you need to translate a document or write something in a foreign language.
While this can be a lengthy and painstaking process in certain word processing programs, the process is relatively simple in Google Docs .
Here's how to translate documents from one language to another or change your typing language in Google Docs .
How to change the language in Google Docs to translate a document
1. Open the document in Google Docs that you want to translate.
2. In the menu at the top of your screen, click "Tools."
3. Click "Translate document."
4. In the pop-up box that appears, type a name for the translated file and choose the language that you want to translate it to via the dropdown menu.
5. Click "Translate." A new window will then appear with your translated document.
How to change the language in Google Docs to type in a different language
1. Create a new document or open one that you've already started by clicking on it in Google Docs .
2. In the top menu bar, click "File."
3. Scroll down and select "Languages," then choose the language that you want to type in by clicking on it.
Note that Google Docs' spell check feature will also change to this language.
Related coverage from How To Do Everything: Tech :
How to use voice typing in google docs, and write just by speaking, how to add a signature in google docs using a free chrome extension, how to get rid of the header in google docs in 3 easy steps, how to convert a google doc to a pdf on your mac or pc, how to convert a pdf to a google doc in a few simple steps on your mac or pc, watch: watch google's i/o 2019 event in 7 minutes.
Check or change language settings
Microsoft's products and services work best if you use the same language and region across all your devices, and in all of your app and Store settings. Some account language settings are roamed across the Microsoft experience.
Pages are in the wrong language
If you're seeing content on our website in the wrong language, check these settings:
PC language settings
The display language you select changes the default language used by Windows features like Settings and File Explorer.
Open language settings
Tip: Learn how to change the display language in macOS .
Browser language settings
Open Microsoft Edge settings to change the browser's display and editor language.
Select then Settings
Tip: Learn how to change the display language in Chrome or Firefox .
Microsoft Account language settings
Sign in to your Microsoft account to change the display language.
Outlook.com or Hotmail language settings
Sign in to your Outlook.com account to change the display language.
OneDrive language settings
Sign in to your OneDrive account then select Settings to change the display language for OneDrive.
Microsoft Store region settings
Caution: If you change your country or region in Microsoft Store, items you bought in one region might not work in another. It's best to change your region only if you’re moving to a new country or region for an extended period. Learn more .
Go to Microsoft Store online . At the very bottom of any page, select the World icon to choose your language and region.
Microsoft support language settings
Microsoft.com is available in a variety of countries/regions. Choose your language preference .
Cortana language settings
Cortana works best if you use the same language for Speech and your device.
Speech language settings
Sign out and then sign back in for the new settings to take effect.
Need more help?
Want more options.
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Microsoft 365 subscription benefits
Microsoft 365 training
Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.
Ask the Microsoft Community
Microsoft Tech Community
Microsoft 365 Insiders
Was this information helpful?
Thank you for your feedback.
How TO - Google Translate
Learn how to add a Google Translate button on your web page.
Google Translate Button
Start with a simple basic web page.
Add a <div> element with the id "google_translate_element":
Add a reference to the translate API at google.com:
And you are ready to translate the content of your page:
There are currently three different design modes for the Google Translate button.
A dropdown menu, with no other text:
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
Top references, top examples, get certified.
- Español – América Latina
- Português – Brasil
- Android Studio
- Android Developers
- Android Gradle Plugin
Java versions in Android builds
Whether your source code is written in Java, Kotlin, or both, there are several places you must choose a JDK or Java language version for your build.
- Tools, such as a compiler, profiler, and archive creator. These are used behind the scenes during your build to create your application.
- Libraries containing APIs that you can call from your Kotlin or Java source code. Note that not all functions are available on Android.
- The Java Virtual Machine (JVM), an interpreter that executes Java applications. You use the JVM to run the Android Studio IDE and the Gradle build tool. The JVM is not used on Android devices or emulators.
How do I choose a JDK to run Android Studio?
We recommend that you use the JBR to run Android Studio. It's deployed with and used to test Android Studio, and includes enhancements for optimal Android Studio usage. To ensure this, don't set the STUDIO_JDK environment variable.
The startup scripts for Android Studio look for a JVM in the following order:
- STUDIO_JDK environment variable
- studio.jdk directory (in the Android Studio distribution)
- jbr directory (JetBrains Runtime), in the Android Studio distribution. Recommended.
- JDK_HOME environment variable
- JAVA_HOME environment variable
- java executable in the PATH environment variable
How do I choose which JDK runs my Gradle builds?
If you run Gradle using the buttons in Android Studio, the JDK set in the Android Studio settings is used to run Gradle. If you run Gradle in a terminal, either inside or outside Android Studio, the JAVA_HOME environment variable (if set) determines determines which JDK runs the Gradle scripts. If JAVA_HOME is not set, it uses the java command on your PATH environment variable.
For the most consistent results, make sure you set your JAVA_HOME environment variable, and set the Gradle JDK in Android Studio to that same JDK.
When running your build, Gradle creates a process called a daemon to perform the actual build. This process can be reused, as long as the builds are using the same JDK and Gradle version. Reusing a daemon reduces the time to start a new JVM and initialize the build system.
If you start builds with different JDKs or Gradle versions, additional daemons are created, consuming more CPU and memory.
Set the Gradle JDK in Android Studio
To set, and optionally download, the JDK that Android Studio uses to run Gradle, go to Settings > Build, Execution, Deployment > Build Tools > Gradle and edit the Gradle JDK field.
Make sure to choose a JDK version that is higher than or equal to the JDK versions used by plugins that you use in your Gradle build. To determine the minimum required JDK version for the Android Gradle Plugin (AGP), see the compatibility table in the release notes .
For example, the Android Gradle Plugin version 8.x requires JDK 17. If you try to run a Gradle build that uses it with an earlier version of the JDK, it reports a message like:
Which Java APIs can I use in my Java or Kotlin source code?
An Android application can use some of the APIs defined in a JDK, but not all of them. The Android SDK defines implementations of many Java library functions as part of its available APIs. The compileSdk property specifies which Android SDK version to use when compiling your Kotlin or Java source code.
Each version of Android supports a specific version of the JDK and a subset of its available Java APIs. If you use a Java API that's available in a compileSdk that's not available in the specified minSdk , you might be able to use the API in the earlier version of Android through a process known as desugaring . See Java 11+ APIs available through desugaring for supported APIs.
Use the table below to determine which Java version is supported by each Android API, and where to find details on which Java APIs are available.
Which JDK compiles my Java source code?
The Java toolchain JDK contains the Java compiler used to build any Java source code. This JDK also runs the Kotlin compiler (which runs on a JVM), javadoc, and tests run during the build.
The toolchain defaults to the JDK used to run Gradle. If you use the default and run a build on different machines (for example, your local machine and a separate Continuous Integration server), the results of your build can differ if different JDK versions are used.
To create a more-consistent build, you can explicitly specify a Java toolchain version. Specifying this:
- If no compatible JDK exists (and a toolchain resolver is defined), downloads one.
- Exposes the toolchain Java APIs for calls from source code.
- Compiles Java source using its Java language version.
- Supplies defaults for sourceCompatibility and targetCompatibility .
We recommend that you always specify the Java toolchain, and either ensure that the specified JDK is installed, or add a toolchain resolver to your build.
You can specify the toolchain whether your source code is written in Java, Kotlin, or both. Specify the toolchain at the top level of your module's build.gradle(.kts) file.
If your source code is only written in Java, specify the Java toolchain version like this:
If your source is only Kotlin or a mix of Kotlin and Java, specify the Java toolchain version like this:
The toolchain JDK version can be the same as the JDK used to run Gradle, but keep in mind they serve different purposes.
Which Java language source features can I use in my Java source code?
The sourceCompatibility property determines which Java language features are available during compilation of Java source. It does not affect Kotlin source.
If not specified, this defaults to the Java toolchain or JDK used to run Gradle. We recommend that you always explicitly specify a toolchain (preferred) or sourceCompatibility .
Specify sourceCompatibility in your module's build.gradle(.kts) file.
Which Java binary features can be used when I compile my Kotlin or Java source?
Specifying targetCompatibility and jvmTarget determines the Java class-format version used when generating bytecode for compiled Java and Kotlin source, respectively.
Some Kotlin features existed before equivalent Java features were added. Early Kotlin compilers had to create their own way to represent those Kotlin features. Some of these features were later added to Java. With later jvmTarget levels, the Kotlin compiler might directly use the Java feature, which might result in better performance.
targetCompatibility defaults to the same value as sourceCompatibility , but if specified, must be greater than or equal to sourceCompatibility .
jvmTarget defaults to the toolchain version.
Different versions of Android support different versions of Java. You can take advantage of additional Java features by increasing targetCompatibility and jvmTarget , but this might force you to also increase your minimum Android SDK version to ensure the feature is available.
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-11-02 UTC.
- Help Center
- Google Docs Editors
- Terms of Service
- Submit feedback