How JVM is loaded in your program ?

K

koolViru

As JVM is not an .exe , it is like a dll ,,,So we can not give any
command on prompt to load he JVM into memory ,,,then

Can anybody Please tell me that how JVM is loaded when you run a Java
program ?
 
T

Tjerk Wolterink

koolViru said:
As JVM is not an .exe , it is like a dll ,,,So we can not give any
command on prompt to load he JVM into memory ,,,then

Can anybody Please tell me that how JVM is loaded when you run a Java
program ?


when you run java.exe or javaw.exe the exe well load the virtual machine
and execute the java program ( wich you give as a parameter):

java.exe -jar program.jar
 
K

koolViru

Dear Tjerk Wolternik,
I am completely agreed with U dat the 'java' command OR the
java.exe to which , when we provide the our program's class file name
as an argument it will first load the JVM ,
But I am interested in knowing the whole under-the-hood process
inside O.S. dat how O.S. finds the runtime/JVM which in jdk directory
? i.e when we provide the command 'java' . and How exactly O.S.'s
will get the JVM first ?? though it has been provided with our
program's class filename as an argument on command line ,,, !!! ,,,???
& then when JVM is loaded by the java.exe how it handovers the
responsibility of "excution of our program's class filename" to the JVM
,,,???

Wat exactly happens inside there into the System & in memory ,,,
throught the process ,,,,???


If nebody can provide me a better explaination ,,,it will be very
much helpful to everybody ,,,,!!!!
 
J

jan V

on command line ,,, !!! ,,,???

Most keyboards allow the keycaps to be removed so you can clean the key
bounce mechanism... should solve your sticky keys problem.
 
A

Andrew Thompson

Dear Tjerk Wolternik,

This is not email.
I am completely agreed with U dat

'U dat'? Please use a spell checker if your English
is that bad*. If your English is good enough for you
to understand what is wrong with those words, then
'please don't be cute'.

* Alternately, use any of the languages that Google
will offer to translate and post both 'native tongue
and translated version'.
But I am interested in knowing the whole under-the-hood process
inside O.S.

<Zen question>
Which OS?
If nebody can provide me a better explaination ,,,it will be very
much helpful to everybody ,,,,!!!!

Your questions can probably be answered with some
searching of Sun's site.

And if you can fix that s-s-s-s-s-stuttering
keyboard of yours, I'm sure that would be very
helpful to everybody here.
 
R

Roedy Green

Can anybody Please tell me that how JVM is loaded when you run a Java
program ?

you fire up java.exe, like any large Windows program it loads some
DLLs, and then it loads your class file.
 
C

Chris Uppal

koolViru said:
But I am interested in knowing the whole under-the-hood process

I think that you'll find a lot of the answers to these question (which,
unfortunately I was not able to read) if you realise the following:

When a Java program is started, the program that starts it is a normal C (or
C++) program that uses the defined JNI interfaces to create and initialise a
JVM[*], and then uses more JNI interfaces to find the main() class and method,
and call it.

(The JMP implementation is packaged as a DLL on Windows, or as something
similar on Unix, so "creating" a JVM is basically a matter of loading the DLL,
then calling the functions defined in that library.)

You can find the source (it's not long or complicated) to the java.exe program
as part of the standard JDK. I think it's in src.zip, in the launcher/
subdirectory.

You can read all about JNI as part of the standard Java documentation that
comes with the JDK. There is also a trail about JNI in the Java tutorial on
Sun's website. Also the complete text of a book about JNI is somewhere on the
Sun website too (I can't remember where offhand).

If you want to get deeper into this, and study things like memory allocation,
and other implementation details, then you will need to look into the
implementation of the whatever JVM you are using. There are a few good books
(and no bad books that I know of) about JVM implementation in general. For
details about any specific version of any specific vendor's JVM implementation
then you will have to look for that vendor's documentation. Both Sun and IBM
publish quite a lot of information about their respective implementations.

For information about the /kinds/ of advanced techniques that are used in
modern JVMs you can also look for research papers. There are many such on the
web. Don't only look at papers about Java VMs -- most of the techniques were
originally invented for use for other (better) languages such as Lisp or
Smalltalk.

There are also several free JVM implementations for which the source is
available (including "advanced" implementations like the IBM "jikes" JVM (not
to be confused with the "jikes" compiler)). In fact you can download the Sun
JVM source from their website too, but I advise that you check the licence
conditions /very/ carefully -- there are two licenses, and one of them
effectively prohibits you from ever working on a JVM implementation of any sort
unless you work for Sun.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top