I'm making a small launcher program for my Java program, the idea being that i can set memory requirements, associated libraries, and stuff like that before calling Java.
However, i'm increasingly finding that there doesn't seem to be a set-in-stone way to call Java from ANYTHING.
- It is no longer the case that there's a java.exe in system32, so that's not guaranteed.
- On most computers there's a registry entry either under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER that defines a JRE subkey, then a JavaHome value. That works on most computers, but on my new computer (fresh java install, built less than two weeks ago) these registries don't exist. There's a JRE entry in CURRENT_USER, but no JavaHome.
- The JAVA_HOME environment variable isn't always set, or set correctly. Specifically on machines that don't have the JDK installed.
- I obviously can't rely on Java being installed to C:/Program Files/Java.
How the bleep am i supposed to be able to call a java program reliably from a C++ one? Or for that matter, from anywhere? I could have my program try all four possible methods, but what if they come up empty?
Thanks in advance.