tags:

views:

265

answers:

1

I have a Java application which is using a certain Java Runtime Environment. The application uses it's own launcher to startup the java virtual machine. No use of the java.exe, javaw.exe, javaws.exe binaries is being made -- as the application seems to have it's own launcher which is a different executable. This custom launcher is using the rest of the JRE files, such as bin/client/jvm.dll and rt.jar package etc.

Now, the problem is that I want to set a boot class path for this custom launcher. The custom launcher does not support the -Xbootclasspath command line parameter, like the default java.exe does.

Is there any way for me to set the boot class path now for this java runtime environment?

Thanks in advance.

Some things to keep in mind:

  1. I do not have the source of this application
  2. This is meant for self and personal debugging use only, not for distribution

Update: not getting a lot of replies, so let me rephrase my question. Books like http://my.safaribooksonline.com/0672326388/ch15lev1sec5 tell you to set the -Xbootclasspath, however how does one set such path when the application has it's own JRE launcher directly loading the java libraries without usage of the default java.exe etc. executables?

+1  A: 

If I understand you correctly, the custom launcher is some native code app that starts the JVM to run the Java app; i.e. java.exe etc, ... but different.

A couple of things that might work are:

  • adding your JAR to the Java installation's "endorsed" directory, or

  • inserting your stuff inside the installation's "rt.jar" file, or some other standard JAR.

But in both cases, you could be changing the behavior of the Java installation for every application (and person) that uses it.

Stephen C
About right, just that it doesn't start java.exe but I think it does what java.exe does, aka starting up the virtual machine. Unfortunately the rt.jar file is signed (checksum probably) and any change to it will cause the program to not load up the java runtime environment. Unfortunately it doesn't seem like the application looks in the "endorsed" folder for boot classes by default either. Am I out of options now?
Tom
"Am I out of options now?" I think so. You may already be skating on thin ice *vis-a-vis* reverse engineering.
Stephen C
Seems weird to me how I don't have control over my own java runtime environment. I probably have to manipulate the custom launcher now to avoid checksum validation of the rt.jar archive, shame I have no experience in this field.
Tom
"Seems weird to me how I don't have control over my own java runtime environment." - The application has taken control / removed your choices by using a custom launcher. (This is analogous to a binary C++ app that has been linked against particular versions of runtime libraries. You ability to "tweak" has been greatly reduced.)
Stephen C