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

Java Java Data Structures Organizing Data Serialization

I am getting this error if i run this whole program on java SDK 7 "Error:(9, 12) java: try-with-resources is not sup

can you help me with this error,,, i am using java SDK 7

"Error:(9, 12) java: try-with-resources is not supported in -source 1.6 (use -source 7 or higher to enable try-with-resources)"

2 Answers

Justin Kraft
Justin Kraft
26,327 Points

If you are using your own software and not workspaces (e.g. Eclipse). The first thing to check is your preferences or locate the java directory and check for installed sdk. If the sdk is not what you expect you'll have to uninstall the current one and replace it (sdk 6 -> 7). Remember to update your environmental variables (JAVA_HOME) upon doing so. Let me know what you find and if it helps.. I can guide you better after knowing so.

try to use java version 8