• Post Reply Bookmark Topic Watch Topic
  • New Topic

Where is java.lang package??  RSS feed

 
Kums Vijayan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just curious where will the java.lang file which is de path of de default package of java is saved in our jdk folder??
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

"java.lang" is not a file, it is a package. The classes contained in it are kept with all the other classes in a big jar file somewhere in the JDK installation. The fact that you don't have to import that package in your source file is merely a convenience provided by the compiler; it does not make that package special in any other way.
 
Kums Vijayan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for dis info...But where in particular will de java.lang package stored and will it be invoked by de java complier or JVM???
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look through your JDK installation, you will find a big jar file somewhere that contains all the classes. You can use the "jar" tool -and particularly the "jar -tf" option- to examine what's in a jar file.

I'm not sure what you mean by "invoke" - the classes are *used* by the JVM, and thus by all tools that use the JVM: java, javac, jar, ...
 
Kums Vijayan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks... got de jar file...it was in C:\Program Files\Java\jdk1.6.0_11\jre\lib\rt.jar
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are interested in the source code of classes in the java.lang package, then have a look at your JDK installation directory; you'll find a file named src.zip there that contains the source code.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kums Vijayan wrote:de path of de default package

Kums Vijayan wrote:dis info... [snip] de java.lang package [snip] de java complier

Kums Vijayan wrote:got de jar file...

Please use real words. It's "the" and "this", not "de" and "dis".
 
Kums Vijayan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!