My installation requires a few files to be added to the JRE lib and bin folders and so it is imperative that the launcher uses this JRE to run the application. Since some systems have multiple JRE installations, using the java -jar my_app.jar is not guaranteed to be using the latest JRE version that the installer uses.

I've looked at the java launcher docs and cannot find a way to specify this. It seems that the launcher simply invokes java. Any ideas?

I need something like: c:\program files\java\jre7\bin\java.exe -jar my_app.jar

asked 31 Jul '13, 22:57

JustinB's gravatar image

JustinB
1111
accept rate: 0%


If you do not provide a <preferredJavaBinary>, the Java launcher will autodetect the system Java, using the first one found by default. This behaviour can be set to use the newer one using the <selectionOrder> setting:

<createJavaLaunchers>
  <destination>${installdir}/launchers</destination>
  <javaLauncherList>
    <javaLauncher>
      <selectionOrder>newest</selectionOrder>
      <binaryName>myLauncher</binaryName>
      <jarFile>testapplication.jar</jarFile>
    </javaLauncher>
  </javaLauncherList>
</createJavaLaunchers>
link

answered 01 Aug '13, 18:04

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×40
×13

Asked: 31 Jul '13, 22:57

Seen: 1,093 times

Last updated: 01 Aug '13, 18:04