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

HOW DO I STOP AN OLD PROGRAM FROM RUNNING IN A NEWLY CREATED JAVA CLASS.

Hi guys, I've created a new program in intelliJ idea but everytime I run it I'm prompted for the code from a previous program.I know there is a way to clear previous programs by right clicking in the editor that Craig mentioned but can't remember where it is.

Would appreciate some help. Many thanks,Chris.

Can you post the message you are getting in IntelliJ? I'm not sure if I fully understand the issue you're running into.

1 Answer

Hi Jen, I've figured out the problem.I had created three Java classes, Java Basics, Java for Beginners and Java Main.When I created and ran a program in Java for Beginners I was getting the results from the code I had created in Java Main without realizing that in order to run a particular class it needs to be selected from the dropdown menu in the top right of the interface. Beginners mistake but thanks for responding.