Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java

Henning Bang Halvorsen
Henning Bang Halvorsen
16,239 Points

.Class files won't update!

Hello!

I'm having an issue with compiling my Java-programs using cmd. It worked fine until suddenly the program did not get the new changes I did in the code, so when I ran a program I was certain would work, It was simply giving errors from a previous state in the code development.

I then tried to delete the .class files and recompile my program. Then the changes were made, and the program worked!

Any idea why these .class files stopped automatically updating? Is there anything I can do to make it work again, without having to delete the .class files between each compile?

Thanks!

  • Henning

2 Answers

Dennis Mårtensson
Dennis Mårtensson
7,400 Points

Are you working in a Treehouse workspace? Because that has happened to my from time to time too. I simply closed the Workspace and reopened it and then it worked.

Henning Bang Halvorsen
Henning Bang Halvorsen
16,239 Points

No, I'm just using a simply text editor (Visual Studio Code) and I'm compiling my programs using the command prompt on windows.