Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use of rt.jar

 
vikas malviya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello............
is it necessary to include any of the below jar files in the classpath

1.rt.jar ,tools.jar,dt.jar

2.what is the use of these jar files???




Regards,
Vikas Malviya
 
Campbell Ritchie
Sheriff
Pie
Posts: 48930
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Unless you use a very old JVM, it will automatically search those .jars.

The Sun Java API classes are (I think) inside rt.jar. On my machine dt.jat appears to contain all the Swing class files. You will have difficulty running anything without rt.jar!
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it's not necessary. They contain code that's used by the various tools (java, javac, javadoc, jar, ...) and other stuff used internally by the JVM. But the JVM knows how and where to find these jar files, so you don't need to worry about them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic