4

Possible Duplicate:
Where to find source code for java.lang native methods?

Where can I find Java’s native method implementations of JDK 1.6 Windows platform?

Community
  • 1
  • 1
Tom
  • 41
  • 1
  • 1
    http://stackoverflow.com/questions/2292629/where-to-find-source-code-for-java-lang-native-methods – pholser Aug 22 '11 at 15:11

2 Answers2

0

Here is how Googles Dalvik VM implements it, I can't imagine the windows or any other version to be much different.

 241 /*
 242  * static long currentTimeMillis()
 243  *
 244  * Current time, in miliseconds.  This doesn't need to be internal to the
 245  * VM, but we're already handling java.lang.System here.
 246  */
 247 static void Dalvik_java_lang_System_currentTimeMillis(const u4* args,
 248     JValue* pResult)
 249 {
 250     struct timeval tv;
 251 
 252     UNUSED_PARAMETER(args);
 253 
 254     gettimeofday(&tv, (struct timezone *) NULL);
 255     long long when = tv.tv_sec * 1000LL + tv.tv_usec / 1000;
 256 
 257     RETURN_LONG(when);
 258 }

Source

Andrew
  • 13,757
  • 13
  • 66
  • 84
0

That depends on which VM you are using. The sources of the Sun / Oracle JDKs can be found here:

http://download.java.net/jdk6/source/

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588