• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Where is Java?

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where on my computer (win) can I find the java packages?

After I installed java, I got a new directory called "c:\java"

But, I am sorry, when I looked inside I could not see the java pacgage hierarchy: java.net, java.io, java.applet etc.

When I made a search for "java" over my c:\ hard drive, I got a directory which is called "java" that had all the java hierarchy inside it, but could not understand from windows where it is physically located on my c:\ hard drive.

1) what actually are those things that I saw in the c:\java

2) what actually is that mysterious java directory that I have found in my search and where is it physically located on my c:\ hard drive.

Thank...
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're looking for the source .java files, they aer installed optionally in a ZIP archive inside the Java directory. When I installed JDK 1.5, I told it to put it all in c:\Java\jdk1.5.0_01. The sources were in the archive c:\Java\jdk1.5.0_01\src.zip. You can unzip them and browse at your leisure.
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I can see that src.zip in my c:\java

How can java use them if they are trapped inside that zip file?
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I expect that the actual .class files for the Java classes with names starting with java. and javax. are packed into Java ARchive (JAR) files, whose names I don't know offhand. This saves disk space and makes searches for the classes your programs need faster and less platform-dependent.

If you want to explore the Java library classes, just download the source code here:
http://java.sun.com/j2se/1.5.0/download.jsp

Not only do they help you understand these classes better, but the code itself was written by some of the best Java programmers around and I found the coding style, organization, and use of encapsulation worth studying.

One word of warning: writing programs that depend on the internal structure of library classes, not just their public interface, is considered bad practice and is risky because Sun is free to change implementation in new releases even if this breaks your code.

Seeing the way the Java language is used by James Gosling and his colleagues refutes some of the coding no-no's I have seen in school and on this site. It reminds me of the Woody Allen movie "Annie Hall". Standing in line for a movie, Allen gets incensed when a loudmouth misinterprets the work of Marshal McLuhan so Allen pulls McLuhan himself from off-camera and McLuhan corrects the man.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most of the actual runtime API classes are in java\jre\lib\rt.jar . Some more esoteric ones are in other jars in that directory or elsewjere.
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all for your replies.

In the readme.html file in the c:\java it says JavaTM 2 Platform Standard Edition - Development Kit 5.0

Also, a few days ago I was trying to install j2sdkee1.3.1
It is not the lastest version however I was trying to run hsqldb 1.6.1 database on my computer and they said it will work with 1.4.1

So I got another directory called c:\j2sdkee1.3.1

Why can I not find any src.zip and jre directory in that c:\j2sdkee1.3.1 directory, and if they are not there then what is that directory supposed to do?

Thank you for your help.
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Joseph Sweet:
Yes I can see that src.zip in my c:\java

How can java use them if they are trapped inside that zip file?

Those are the Java source files -- the human-readable text files. They were compiled (using javac) into bytecode .class files that the JVM uses to run code. Those are stored as Ernest said inside a JAR file. The reason the sources are left as a ZIP is to save disk space in case you didn't really want to look at the files. Just unZIP them into the same directory so you can explore them as they're a great compliment to the JavaDocs.

Why can I not find any src.zip and jre directory in that c:\j2sdkee1.3.1 directory, and if they are not there then what is that directory supposed to do?

The J2EE SDKs (j2sdkee) are only extensions of the JDK -- they add more classes for the J2EE APIs, but the SDK itself does not contain a javac compiler or JRE (JVM for running code). You use the JDK and JRE you already have to use them.

I don't remember off-hand if the sources are included by default with the J2EE SDKs. If not, then go back to the download site and grab them; they should be a separate package. They are definitely available.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic