SyMenu Forum



HomeConfigure portable programs

How to configure programs in SyMenu

A jar program configuration in SyMenu Messages in this topic - RSS

Posts: 1002

Posts: 1002
Normally a jar program could be executed with a simple double click. In fact, if Java is correctly installed and your environment is well configured, the jar extension is associated with the java.exe program that takes care of the jar file and executes it.

But what if, for example, you have no Java installed? Or what if your jar association is broken? Or you want to execute a program with a different version of Java?

My example doesn't want to be exaustive or the best solution in the world but it is only a fast and clean solution to this problem.

For first I put an entire JRE under the SyMenu control. My main SyMenu installation resides in an USB device so my JRE becomes completely portable.
I have some jar programs on the same USB device and I want they execute regardless on the local PC Java installation or lack of it.
I create an empty program item inside the SyMenu configuration form.
I link the path with my portable JRE java executable (i.e. .\ProgramFiles\JavaRuntimeEnvironment\bin\java.exe).
In the Additional Params section, inside the Program Arguments textbox, I put the parameter that Java needs to execute the jar (i.e. -jar JCloisterZone.jar).
For last in the Advanced section, inside the Working Directory textbox, I put the folder in which the jar program is located (i.e. #:\SyMenu\ProgramFiles\SPSSuite\SyMenuSuite\JCloisterZone_-_Carcassone_clone_sps).
Done. You have your jar program executing with your portable JRE environment.

Note that there are a lot of different configuration you could choose between.

For example the Working Directory not only support the universal unit identifier (#:\) but you can choose a more common relative path. The string then becomes:

Or you can remove the Working Directory string and work only with the parameters, replacing the Program Arguments with this string:
-jar #:\SyMenu\ProgramFiles\SPSSuite\SyMenuSuite\JCloisterZone_-_Carcassone_clone_sps\JCloisterZone.jar

Note again that the command line parameters don't support relative paths and remember that in case your path as some spaces inside you have to put the entire path among quotation marks... well Windows rules here.

UGMFree.NET ©2002-2020
By Gianluca Negrelli - Contact me