com.google.android.studio :
Exception in thread "main" java.lang.NoClassDefFoundError: java.awt.Toolkit
com.google.android.studio : at sun.awt.AppContext$2.run(AppContext.java:217)
com.google.android.studio[2226]: at sun.awt.AppContext$2.run(AppContext.java:213)
com.google.android.studio[2226]: at java.security.AccessController.doPrivileged(Native Method)
com.google.android.studio[2226]: at sun.awt.AppContext.initMainAppContext(AppContext.java:251)
com.google.android.studio[2226]: at sun.awt.AppContext.access$200(AppContext.java:124)
com.google.android.studio[2226]: at sun.awt.AppContext$3.run(AppContext.java:339)
com.google.android.studio[2226]: at java.security.AccessController.doPrivileged(Native Method)
com.google.android.studio[2226]: at sun.awt.AppContext.getAppContext(AppContext.java:221)
com.google.android.studio[2226]: at sun.awt.AppContext$6.getContext(AppContext.java:557)
com.google.android.studio[2226]: at sun.misc.SharedSecrets.getJavaAWTAccess(SharedSecrets.java:134)
com.google.android.studio[2226]: at java.util.logging.LogManager.getUserContext(LogManager.java:241)
com.google.android.studio[2226]: at java.util.logging.LogManager.getLogger(LogManager.java:894)
com.google.android.studio[2226]: at java.util.logging.LogManager.demandLogger(LogManager.java:291)
com.google.android.studio[2226]: at java.util.logging.Logger.demandLogger(Logger.java:463)
com.google.android.studio[2226]: at java.util.logging.Logger.getLogger(Logger.java:243)
com.google.android.studio[2226]: at java.awt.Component.(Component.java:356)
com.google.android.studio[2226]: at com.intellij.idea.Main.showMessage(Main.java:467)
com.google.android.studio[2226]: at com.intellij.idea.Main.showMessage(Main.java:267)
com.google.android.studio[2226]: at com.intellij.idea.Main.main(Main.java:24)
Solution: If you get the above stack-trace in Android Studio then the reason is the Java JDK version. If you are working on macOS Version 10.6 or lower you cannot install JDK1.7.
More Posts related to Android-Studio,
- Step-by-Step: How to install Flutter in Android Studio
- [Android Studio] How to locate code for activity_main.xml
- [Event Log] Android Studio performance could be improved
- Android Studio emulator/Device logCat logs not displayed
- Show Android Studio Emulator in a Separate Window
- Android Studio SDK Build-tools 23 rc2 not getting installed
- Android Emulator Screenshot saved location
- [Android Studio] Error: Missing system image on device
- Android Studio NoClassDefFoundError: java.awt.Toolkit
- Android [SDK Manager] The system cannot find the path specified
- [Android Studio] Could not automatically detect an ADB binary
- Installing Android Studio Dolphin on Mac with Apple (M1/M2) Chip
- [Android Studio] MainActivity does not exist
- How to enable line numbers in IntelliJ Android Studio for all files
- Android Studio - Installed build tools revision 31.0.0 is corrupted. Remove and install again using the SDK manager.
- Android Studio setup was canceled - How to resume
- Your Android SDK is missing, out of date or corrupted SDK Problem
- Locate MainActivity Java or Kotlin file in Android Studio
- How to Determine Android Studio Gradle Version
- Delete Android Studio Projects
- [Android Studio] Button on click example
- Create assets folder in Android Studio
- Disabling Spell Check in Android Studio
- How to save IntelliJ IDE Console logs to external log file
- How to install Android Studio Chipmunk and SDK tools on macOS (2021.2)
More Posts:
- SharePoint installation error - Setup is unable to proceed due to the following error This product requires Microsoft .Net Framework 4.5 - SharePoint
- [Fix] reCAPTCHA not working in Web Browser - Google
- Convert Java Object to JSON using Jackson Library - Java
- Fix Microsoft Teams Error code - 107 - Teams
- [Fix] Microsoft Teams No Network Connection Please check your network settings and try again. [2603] - Teams
- How to revert a single file from Git Repo - Git
- How to stop MongoDB Server running on Ubuntu - Ubuntu
- Can we move apps like WhatsApp, Facebook to external MicroSD card - WhatsApp