tags:

views:

622

answers:

3

This may sound like a stupid question. Where are the core class files from Sun, like Button.class, located in the JDK installation folder C:\Program Files\Java\jdk1.5.0_12?

Or do the class files reside in C:\Program Files\Java\jre1.5.0_12 folder?

+2  A: 

They are spread between several jars. It looks like Button is in jre/lib/rt.jar though.

Mongo
It appears that she has JDK and JRE installed, and the JDK includes a JRE, so jre/lib/rt.jar is ambiguous
Uri
+2  A: 

The class files actually reside as jar files inside the Java distribution being used. Most files are in rt.jar (runtime).

Most developer machines actually have two forms of Java installed. The JDK (which you would often be using when developing and includes the compiler), and the JRE which is used by downloaded Java based applications, and often your web browser. Those are typically two independent distributions that don't know about each other. So the answer to your question is unfortunately, "depending what it is that you are running". To make things worse, the JDK may include it's own copy of the JRE...

This is one of the sources of the so-called classpath hell, because it is not always clear what you are using when you are running a java program.

If you run java from the command line, you can sometimes detect the exact version being used.

If you use Eclipse, you can pick version of the JDK you are working with.

Uri
Just to clarify, nondeveloper machines often have JRE but not JDK.
Uri
A: 

On Both.

They are two different JVM's installations. One used to compile ( JDK stands for Java Development Kit ) and the other is the java environment which most customers machine have ( JRE stands for Java Runtime Environment )

Look on any of those two for a file named:

rt.jar

That where the core of the platform resides.

OscarRyz