Android Studio NoClassDefFoundError: java.awt.Toolkit : 
Exception in thread "main" java.lang.NoClassDefFoundError: java.awt.Toolkit : at sun.awt.AppContext$[2226]: at sun.awt.AppContext$[2226]: at Method)[2226]: at sun.awt.AppContext.initMainAppContext([2226]: at sun.awt.AppContext.access$200([2226]: at sun.awt.AppContext$[2226]: at Method)[2226]: at sun.awt.AppContext.getAppContext([2226]: at sun.awt.AppContext$6.getContext([2226]: at sun.misc.SharedSecrets.getJavaAWTAccess([2226]: at java.util.logging.LogManager.getUserContext([2226]: at java.util.logging.LogManager.getLogger([2226]: at java.util.logging.LogManager.demandLogger([2226]: at java.util.logging.Logger.demandLogger([2226]: at java.util.logging.Logger.getLogger([2226]: at java.awt.Component.([2226]: at com.intellij.idea.Main.showMessage([2226]: at com.intellij.idea.Main.showMessage([2226]: at com.intellij.idea.Main.main( 

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.

Recent Posts:

Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.