Finding path to JRE

M

Murrgon

Is there some official way to find the location of the OS's
JRE? I am running a win2k system and I want to start up the
JVM using JNI_CreateJavaVM(). However, to be able to
GetProcAddress() this function I first need to be able to
find the jvm.dll and LoadLibrary() it.

Thanks
Murrgon
 
T

Thomas Kellerer

Murrgon said:
Is there some official way to find the location of the OS's
JRE? I am running a win2k system and I want to start up the
JVM using JNI_CreateJavaVM(). However, to be able to
GetProcAddress() this function I first need to be able to
find the jvm.dll and LoadLibrary() it.

Thanks
Murrgon

The source ZIP for the JDK contains the C code for the Java launcher as
well. You might want to have a look at the code to find out how it finds
the JDK/JRE. I guess this would be the "most official" way :)

Thomas
 
M

Murrgon

Thomas said:
The source ZIP for the JDK contains the C code for the Java launcher as
well. You might want to have a look at the code to find out how it finds
the JDK/JRE. I guess this would be the "most official" way :)

Good suggestion. I took a look at the code and they're just reading the
details from the registry. I am assuming that each platform that is
supported has their own method for retreiving this info.

Murrgon
 
R

Roedy Green

Is there some official way to find the location of the OS's
JRE? I am running a win2k system and I want to start up the
JVM using JNI_CreateJavaVM(). However, to be able to
GetProcAddress() this function I first need to be able to
find the jvm.dll and LoadLibrary() it.

If you use Java Web Start they find it for you. You just give you
list of preferences.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top