Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

basically I have MyApplication.jar and a nasty native library that will only work with 32-bit JRE. I bundled the 32-bit JRE in the /JREF folder resides in the same directory as the MyApplication.jar

How to write a script that will launch MyApplication.jar using the bundled JRE inside the /JREF directory.

Possible for a script to run on windows, mac, and linux?

share|improve this question
    
Write a small Java program that unzips the Jar and runs java.exe with the correct parameters to launch the real program under a different class name? – billc.cn Dec 4 '11 at 10:59
    
Hi unfortunately no. If the user already has 64-bit JRE it will end up using that instead as I've read. The unziping of jar to a temproary location is a possibility but my requirement is that the java application run the bundled 32-bit JRE I included. – Kim Jong Woo Dec 4 '11 at 21:38
1  
What I mean is you allow the host's JVM (whatever version) to run the small piece of program that extracts the 32-bit JVM and uses Runtime.exec() to run the JVM as a separated process with parameters pointing to the real entry point (class name) of your main program. – billc.cn Dec 5 '11 at 10:37
    
+1'd. Ah now I see. Actually that is a really great solution. I will keep that in mind but for the time being I am looking to use scripts to launch the application. – Kim Jong Woo Dec 5 '11 at 10:53

You must log in to answer this question.

Browse other questions tagged .