Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CLASSPATH directive and system archives

 
Brian Lang
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How important is it to have 'tools.jar', 'rt.jar' or anyone of several jdk class archives in the CLASSPATH? Are these required or just additional libraries if you're developing certain applications? I've taken a peek into the files, they don't seem to have anything relevant to me. I can't find anything online to clarify this.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not at all. You don't need to do anything about them in the CLASSPATH. You used to (I am told) for older versions of Java, but not any more. All you need in your CLASSPATH for Java to work is the dreaded black spot (well a dot . or .; or ;. or ;.;) and you might only need that on Windows; my Linux box happily runs Java without anything in the system CLASSPATH at all.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Lang:
I've taken a peek into the files, they don't seem to have anything relevant to me.


Seriously ? You don't use Strings or Objects or any other class from the standard API which are all in rt.jar.

You don't need to include it in your classpath because jar files in the JRE lib directory are read automatically.
 
Brian Lang
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joanne Neal:

Seriously ? You don't use Strings or Objects or any other class from the standard API which are all in rt.jar.

A bit harsh there, Joanne. I said I took a peek, I didn't spend alot of time looking at it. But I did see alot of things I'm not familiar with. While I am fairly competent with the language and syntax, and I can hack together an application to suit a purpose, I have alot to learn. Heck, before a couple of days ago I hadn't ever created my own JAR file!

Originally posted by Joanne Neal:

You don't need to include it in your classpath because jar files in the JRE lib directory are read automatically.

Thank you.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file you do want to peek into is called something like src.zip. Unzip it and you find the original code for all the commonly-used Java API classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic