cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dtra82
Level 2

jvm arguments for launcher

hi all

i've been having an issue with launching an application on mac osx
i've seen some posts in the installshield forum, but they don't really seem to work the same for install anywhere 2008 standard
i am able to run the jar file from the command line with something like
java -jar -XstartOnFirstThread app.jar

but the application crashes almost immediately after starting using the launcher
i don't need to set jvm params for the installer, nor do i need to set arguments for the main method of my application

Launcher properties (in the advanced designer) maybe?
i tried adding the property
lax.nl.java.option.additional with value -XstartOnFirstThread
but no effect

the problem is that i need that -XstartOnFirstThread option set

can anyone help sort this out?
this is obviously not an issue for the windows build we are making

thanks
dave
Labels (1)
0 Kudos
(7) Replies
pv7721
Level 20

Why don't you use the LaunchAnywhere technology instead of manually launching your application's jars? On the other hand this might be an issue caused by the MacOSX JVM (you might have noticed that MacOSX is the only platform for which a JVM cannot be bundled because the OS comes with its own).
0 Kudos
dtra82
Level 2

that's the problem
i tried using the .app that install anywhere creates for me
but it crashes just after the application starts up
it is either a mac or swt error, with one workaround (that i've found)
and that is to start the application with the option -XstartOnFirstThread

i want to know if it is possible to start the app with that option
otherwise i will need to find another workaround

dave
0 Kudos
pv7721
Level 20

What is the JVM version your application is built against and what is the JVM version installed on the target system?
0 Kudos
akarwal
Level 3

Is this issue fixed?
0 Kudos
The_Dean
Level 3

I'm replying to an old post so that I'm the last poor individual who has this problem, Googles for the solution, comes across this promising thread only to be disappointed by the resolution's seeming impossibility.

In InstallAnywhere 2011, I was able to get my Mac launcher working with my SWT app by doing the following:

In the Install task, select your launcher.
Click on the Edit Properties button near the bottom of the General Settings tab.
In the LaunchAnywhere Properties window search for the property named "lax.nl.java.option.additional".
If it doesn't exist, click on the Add buton and add it.
Double click on the Value cell to the right of the newly added option.
Enter the value -XstartOnFirstThread
Click OK.

And you're done.

UNLESS you want to run Windows installers as well. In that case, create a rule to have this launcher created only on Mac workstations. Create a second instance of the launcher to run on Windows (with the appropriate rules in place). This second launcher will NOT have this property set. In my experience, the -XstartOnFirstThread option is not valid for Windows JVMs.

I have no experience yet with Linux / Unix installs, so I'm not sure if yet a third (or more) version of the launcher is needed.

Cheers,

Dean.
0 Kudos
The_Dean
Level 3

As it turns out, this seems to only work for the console launcher. When running a graphical launcher, the launcher fails. The graphical launcher appears to ignore the option (as unknown) and then launches the app, which of course fails.
0 Kudos
The_Dean
Level 3

For a graphical launcher, you will need to add this bit of text to your application's Info.plist file, within the Java dictionary:

StartOnMainThread


I don't know of an InstallAnywhere Plist editor, so I will leave the exact implementation up to those who need such.

Dean.
0 Kudos