Am using JNI_CreateJavaVM to embed a VM in my application. But i want to allow users to set switch between "hotspot", "classic" and "server". How does java.exe and javaw.exe implement this?

Davanum Srinivas

  1. "HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment" has a CurrentVersion key. If the value of this key is "1.3.1", then "HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava Runtime Environment1.3.1JavaHome" has the directory where this version of JRE is installed (say "C:Program FilesJavaSoftJRE1.3.1").
  2. Relative to this path a file called "jvm.cfg" in directory "lib" is read. This file contains a list of available JVM versions. On my machine this file contains three lines:
    -hotspot
    -server
    -classic
    
  3. If the user has specified one of the availabe VMs with -version, then that one is chosen, otherwise the VMs are chosen in the order they're specified in the file.
  4. The VM that was selected, say "hotspot", is started by appending "binhotspotjvm.dll" to the JavaHome directory and by using the invocation functions in that dll.

You can find the details in java.c and java_md.c (present in src.jar, that is shipped with the SDK).

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact