Android Studio NoClassDefFoundError: java.awt.Toolkit


Posted on : Fri, 16th Oct 15 01:06 pm UTC
2314 votes
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) 

If you get the above stack-trace in Android Studio then the reason is the Java JDK version. If you are working on Mac OS X OS version 10.6 or lower you cannot install JDK1.7.

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +