Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Creating the Screen Layout Adding a Button

Robert Hirtle
Robert Hirtle
250 Points

I cannot bypass this err. Error:(3, 22) compileSdkVersion android-22 requires compiling with JDK 7

I attempted to download JDK 7 and install but it still will not work. This prevents my preview screen from functioning.

2 Answers

You probably have Java6 installed by default but you need Java7 to compile your project. To verify this run the following at the command prompt:

$ java -version

If you see something like the following:

java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

then it mens that you have Java6 installed. Just go to the Java download page and download and install Java JDK7 or newer.

After installation please check that the correct Java version is being activated by running the same command at the command prompt.

Hope this helps.