Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JVM doubt  RSS feed

 
Sudhakar Reddy Kurakula
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am thinking that JVM will be operating system dependent.So windows will have corresponding JVM ,Unix will have its own JVM and like that.

Now I want to make sure that whether JVM's are written in Java language or like in c or c++.

and one more quesion that is generally we say that java.lang is the default package.can anybody explain me how it will be added to the classpath by automatically and how does it is available to all programs by default.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It shouldnt matter to you what the JVM is written in. By default the java.lang package is available to all classes. Once the java.exe file can be executed, the VM should take care of making the necessary classes available for your program - excluding the libraries that you link to. You either provide library links in the classpath or in a manifest file in a jar
 
David McCombs
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JVM is not written in Java since it needs a JVM to run. Sort of a chicken/egg thing. I believe it is written in C. And yes, the JVM is platform dependent, which is why there are versions for different platforms.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we say that java.lang is the default package.can anybody explain me how it will be added to the classpath by automatically and how does it is available to all programs by default.


The Java runtime environment has several jars with standard, "bootstrap" classes. When a ClassLoader tries to load a class, it will first look in those bootstrap jars.

For more information, read this technote from Sun.
[ December 31, 2006: Message edited by: Scott Johnson ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!