Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JVM does not update file's Last Modified Time

843829May 17 2006 — edited Jun 22 2006
Here is a sample program I used:

import java.io.*;
import java.util.*;

public class TestFile {
public static void main(String[] args) throws Exception {
FileWriter out = new FileWriter("1.txt");
out.append("Just a test");
out.close();
}
}

On first time program runs ok - it creates a file named "1.txt" and writes "Just a test" into it. Last Modified field is ok.
But when I try to run this class second and more times - Last Modified field is not changed!

I tried to install jdk14, jdk16-beta - it doesn't help.

What's wrong? This affects my work with Eclipse and SVN - when I save files in Eclipse "Last Modified" field isn't updated and Subversion doesn't see changes. It is very bad


My primary OS is WinXP SP2
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

I tried this example class on FreeBSD and it works fine!

FreeBSD java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b00)
Java HotSpot(TM) Client VM (build diablo-1.5.0_06-b00, mixed mode)

FreeBSD ***.com 6.1-STABLE FreeBSD 6.1-STABLE #0: Sat May 13 18:14:51 EEST 2006 root@***.com:/usr/obj/usr/src/sys/*** i386
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2006
Added on May 17 2006
6 comments
330 views