How to Configure the Embedded JDK in Android Studio

How to Configure the Embedded JDK in Android Studio
How to Configure the Embedded JDK in Android Studio
Recently, I accidentally found that the environment variable for JDK was not configured correctly.I did not download Java separately because it comes with the embedded JDK when downloading Android Studio.Open “File – Other Settings – Default Project Structure” to see that AS has automatically checked “Use embedded JDK”, which is also the official recommendation.Next, here are the configuration steps for the environment variables.

How to Configure the Embedded JDK in Android Studio

Starting from Java 1.8, the CLASSPATH environment variable is no longer needed. We only need to configure JAVA_HOME and PATH:Set JAVA_HOME to:C:\AndroidStudio\jre (i.e., the JDK installation directory).Add to PATH:%JAVA_HOME%\bin%JAVA_HOME%\jre\bin
Finally, you can test the Java version in cmd.
background-color: var(--color-site-body);    text-rendering: optimizelegibility;    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);    line-height: 'normal';    -webkit-text-size-adjust: 100%;    -ms-text-size-adjust: 100%;}* {    box-sizing: border-box;    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    outline: none;    margin: 0;    padding: 0;}用户代理样式表body {    display: block;    margin: 8px;}@media (prefers-color-scheme: dark) {    :root:not([color-scheme]) {        --block-hover: #1c1c1c;        --text-p1: #fff;        --text-p3: #777;        --card: #fff;        --waline-white: #000 !important;        --waline-light-grey: #666 !important;        --waline-dark-grey: #999 !important;        --waline-text-color: #888 !important;        --waline-bgcolor: #1e1e1e !important;        --waline-bgcolor-light: #272727 !important;        --waline-border-color: #333 !important;        --waline-disable-bgcolor: #444 !important;        --waline-disable-color: #272727 !important;        --waline-bq-color: #272727 !important;        --waline-info-bgcolor: #272727 !important;        --waline-info-color: #666 !important;    }}@media (prefers-color-scheme: dark) {    :root:not([color-scheme]) {        --color-site-body: #121212;        --color-read-bkg: #1f1f1f;        --color-read-post: #262626;        --color-site-bg: #1f1f1f;        --color-site-inner: rgba(238, 238, 238, 0.871);        --color-site-footer: rgba(170, 170, 170, 0.871);        --color-card: #262626;        --color-text: rgba(238, 238, 238, 0.871);        --color-block: #434343;        --color-codeblock: #1f1f1f;        --color-inlinecode: #d56d28;        --color-h1: rgba(255, 255, 255, 0.871);        --color-h2: rgba(255, 255, 255, 0.871);        --color-h3: rgba(255, 255, 255, 0.6);        --color-h4: rgba(255, 255, 255, 0.6);        --color-h5: rgba(255, 255, 255, 0.6);        --color-h6: rgba(255, 255, 255, 0.6);        --color-p: rgba(217, 217, 217, 0.871);        --color-list: rgba(217, 217, 217, 0.871);        --color-list-hl: #63e0c4;        --color-meta: rgba(191, 191, 191, 0.871);        --color-link: rgba(191, 191, 191, 0.871);        --color-copyright-bkg: #21252b;    }}:root {    --waline-font-size: 1rem;    --waline-white: #fff;    --waline-light-grey: #999;    --waline-dark-grey: #666;    --waline-theme-color: #27ae60;    --waline-active-color: #2ecc71;    --waline-color: #444;    --waline-bgcolor: #fff;    --waline-bgcolor-light: #f8f8f8;    --waline-bgcolor-hover: #f0f0f0;    --waline-border-color: #ddd;    --waline-disable-bgcolor: #f8f8f8;    --waline-disable-color: #000;    --waline-code-bgcolor: #282c34;    --waline-bq-color: #f0f0f0;    --waline-avatar-size: 3.25rem;    --waline-m-avatar-size: calc(var(--waline-avatar-size)* 9 / 13);    --waline-badge-color: #3498db;    --waline-badge-font-size: 0.75em;    --waline-info-bgcolor: #f8f8f8;    --waline-info-color: #999;    --waline-info-font-size: 0.625em;    --waline-border: 1px solid var(--waline-border-color);    --waline-avatar-radius: 50%;    --waline-box-shadow: none;}:host, :root {    --fa-font-solid: normal 900 1em / 1 "Font Awesome 6 Free";}:host, :root {    --fa-font-regular: normal 400 1em / 1 "Font Awesome 6 Free";}:host, :root {    --fa-font-brands: normal 400 1em / 1 "Font Awesome 6 Brands";}@media (prefers-color-scheme: dark) {    :root {        --color-mode: 'dark';    }}:root {    --block-hover: #ededed;    --text-p1: #222;    --text-p3: #777;    --card: #fff;}@media (prefers-color-scheme: dark) {    :root {        --color-mode: 'dark';    }}:root {    --color-site-body: #f4f4f4;    --color-site-bg: #f4f4f4;    --color-site-inner: #fff;    --color-site-footer: #666;    --color-card: #fff;    --color-text: #444;    --color-block: #f6f6f6;    --color-inlinecode: #c74f00;    --color-codeblock: #fff7ea;    --color-h1: #003eb3;    --color-h2: #3a3a3a;    --color-h3: #333;    --color-h4: #444;    --color-h5: #555;    --color-h6: #666;    --color-p: #444;    --color-list: #666;    --color-list-hl: #30ad91;    --color-meta: #888;    --color-read-bkg: #e0d8c8;    --color-read-post: #f8f1e2;    --color-copyright-bkg: #f5f5f5;}html, a:not([href]), a:not([href]) p, button[disabled], html input[disabled], .article .widget, #l_body .post section.meta .new-meta-box .new-meta-item .notlink, ul.list-v.rightmenu a, span.btn a:not([href]), div.tabs ul.nav-tabs li.tab.active a, kbd, .a > p, .not-select, .not-select p, .aplayer .aplayer-info .aplayer-music, .gt-container a.is--active, .iziToast, .iziToast p, .iframe, .embed-show, p > img, p > svg, .fix-cursor-default {    cursor: url(https://unpkg.com/[email protected]/media/cursor/left_ptr.png), default;}html {    color: var(--color-text);    width: 100%;    height: 100%;    font-family: Arial, UbuntuMono, "Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, Menlo, Monaco, monospace, sans-serif;    font-size: 16px;}
How to Configure the Embedded JDK in Android Studio

Leave a Comment

×