Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:36:34+00:00 2026-06-09T16:36:34+00:00

I am experiencing a very annoying problem to me, imagine I compile the file

  • 0

I am experiencing a very annoying problem to me, imagine I compile the file FooBar.java:

$ javac FooBar.java

It compiles sucefully and then I run it as usual:

$ java FooBar < in.txt

I get the output as expected, the deal is, if I change the source code (FooBar.java) to print something else and compile it again I get the same output as the first time!

This is really making me mad… is there any cache for the javac? Even if I delete FooBar.class and recompile I get the output from the early source code. The only way I found to solve this is to delete FooBar.java and create a new file with a diferent name (I just copy-pasted the code), this works.

This bug (?) is really bugging me. I’ve searched for a solution or an explanation to why this happens but with no luck.

This seems to be related to my problem but not completely as I am not using any IDE and the Classpath points to my working folder:
http://www.coderanch.com/t/519372/java/java/Executing-Old-Code

I would like to find out what’s causing this as I don’t want to make a new file everytime I update source code… I’m on Windows with Java 1.6.0_27

Thanks for reading…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:36:35+00:00Added an answer on June 9, 2026 at 4:36 pm

    The problem won’t be caching. Try this:

    1. look at the time stamp on your FooBar.class file (this is what is RUN)
    2. do your compile again javac…
    3. look at the time stamp again. Has it changed? if not, you are compiling to somewhere ese.
    4. The comments about the package by other posters would explain this. It would also be explained by having your class path set / changed
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experiencing a very odd problem with a Java application running under Tomcat. We
I'm experiencing a very odd upload problem. Here's the relevant view file: <form action=http://localhost/index.php/temp/upload/
I'm experiencing a very annoying behaviour with the debugger in Visual Studio 2008 Professional.
I am experiencing a very weird problem: In WPF I have a tabControl which
At the moment I am experiencing a very frustrating problem. I will try to
We are experiencing some very annoying deadlock situations in a production SQL Server 2000
I'm experiencing a very strange problem... I have a regular ASP.Net webpage with a
I'm experiencing a very curious problem. I have a list named theorems that has
I'm experiencing a very strange problem... The following trivial test code works as it
I've been experiencing this very odd problem lately in Heroku. I develop and test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.