Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To Check the Source file

 
vitthal wable
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii Friends,
Here I want to know that ; suppose i have .java file and after compilation class file is generated for .java file In this case suppose i want to check that whether java file is changed after compilation, I know that there is command for java Interpreter but i forget it if anyone is aware of that please reply
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check whether the Java file is changed? Check what?

Maybe you mean check whether the Java file is newer than the class file? You'd just use the operating system's last modified time for the two files. If you're doing this in Java, the java.io.File class has a method to check this; otherwise, "ls -l" or "dir" will do the trick.
 
Srinivas Kalvala
Ranch Hand
Posts: 257
Firefox Browser Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Exactly. That what ANT will do. It checks the time stamp .class file with .java file. if the timestamps are diffe then new compilation for that file will be made.

if some one make touch of the .class file then .... ? it recompiles again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic