2

Where does Java keep standard library classes like java.util.* on the hard drive under Windows OS?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Roman
  • 199
  • 1
  • 5

3 Answers3

12

When you say

import java.util.Date;

you are not reading a file. You are telling the compiler to treat the type reference "Date" as if it was "java.util.Date".

When the compiler later resolves java.util.date it will find it in the JDK's jre/lib/rt.jar file.

http://www.velocityreviews.com/forums/t125842-re-newbie-q-where-is-java-util.html

Gary Klasen
  • 1,001
  • 1
  • 12
  • 30
4

If you are looking for the source code, you can find the source code online as described here:

Where to find Java JDK Source Code?

Additionally, you can find it within the src.zip file:

E.g. my own computer this is the:

C:\Program Files\Java\jdk1.7.0_01\src.zip

The actual compiled classes are contained with the **lib/rt.jar file that the compiler and jvm uses.

Community
  • 1
  • 1
Menelaos
  • 23,508
  • 18
  • 90
  • 155
1

In the JDK1.X.X... directory there is a zip file named src.zip. unzip it and have a look. you might want to make a copy of it and move it to another directory before you do it.

conny
  • 11
  • 1