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

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.