# jPortable Launcher: Pass arguments

10 posts / 0 new
sep
Offline
Last seen: 10 years 10 months ago
Joined: 2011-12-04 19:10
jPortable Launcher: Pass arguments

Using the jPortable Launcher, I am able launch a .jar file using the following syntax:

C:\path\to\JavaPortableLauncher.exe C:\path\to\file.jar

This seems to work as if the following was done from a machine with a localized JVM:

java -jar C:\path\to\file.jar

Sometimes a .jar file needs additional arguments entered for it to work properly. If I add the arguments straight after the path to the .jar file, the launcher treats the arguments as part of the path and says that the .jar file cannot be found.

So my question is: Is it possible to pass arguments with the jPortable Launcher?

vf2nsr
Offline
Last seen: 5 years 12 months ago
Joined: 2010-02-13 17:10
Jar file

arguments can be run from the applauncher .ini I have a few apps that I did this with.

For instance this is a launcher I created for jajuk

[Launch]
ProgramExecutable=javaw.exe

CommandLineArguments=-client -Xms20M -Xmx512M -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar %PAL:AppDir%\Jajuk\bin\jajuk.jar -notest
;
[Activate]
Java=require

[FilesMove]
settings\.jajuk_bootstrap=%USERPROFILE%

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Chris Morgan
Offline
Last seen: 7 years 3 months ago
Joined: 2007-04-15 21:08
A bit more

Note that the jPortable Launcher does a little bit more: it puts -Duser.home="$EXEDIR\Data\AppData" (which will cause the settings of many Java apps to be preserved) in the command line as well and sets the APPDATA environment variable to$EXEDIR\Data\AppData (which will do the same for a small number of Java apps).

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

vf2nsr
Offline
Last seen: 5 years 12 months ago
Joined: 2010-02-13 17:10
Not sure

If I did wrong or not. Was just giving him an alternative method

Back to my corner couch

“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss

Chris Morgan
Offline
Last seen: 7 years 3 months ago
Joined: 2007-04-15 21:08

I'm merely adding to it. It's worth investigating in general whether either of these techniques will be useful.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

youdgin
Offline
Last seen: 8 years 11 months ago
Joined: 2012-01-29 11:56
An example??

Does this still work and please could you provide a more specific example.
Applying some intuition i tried to put arguments in JavaPortableLauncher.ini (or should i create applauncher.ini and do smth with it) like this:

[Launch]
ProgramExecutable=javaw.exe
CommandLineArguments=-jar "D:\Documents and Settings\Administrator\Desktop\Upnp portmapper\PortMapper-1.9.5 .jar" -r 21 TCP
;
[Activate]
Java=require

And it doesn't work.

Thanks.

rtokyolivier
Offline
Last seen: 8 years 10 months ago
Joined: 2013-11-20 08:56
Need more explanation

Me too, I've tried above tricks to run microemulator and arguments are needed to implement JSR-75 for example and it doesn't work.
Normally, if JRE is installed in computer, i do it like this and it works perfectly:
C:\windows\system32\java.exe -cp microemulator.jar;lib/microemu-jsr-75.jar org.microemu.app.Main --impl org.microemu.cldc.file.FileSystem org.microemu.examples.fcview.FCViewMidlet apps\operamini.jar

Where to put the inifile? And what is the name of inifile to create?

Thanks

darksabre76
Offline
Last seen: 1 year 4 months ago
Joined: 2011-04-19 23:28
Errant space?

If you copied your launcher exactly, then it's possible you might have a space that is messing it up. Namely, "PortMapper-1.9.5 .jar" should probably be "PortMapper-1.9.5.jar" assuming the rest of the path is correct.

hablutzel1
Offline
Last seen: 8 years 7 months ago
Joined: 2013-04-13 16:28
No "CommandLineArguments" argument available

Using jPortable Launcher (https://portableapps.com/apps/utilities/java_portable_launcher) v3.0 I haven't found any way to add the "CommandLineArguments" arguments with those JVM arguments, so I patched jPortable Launcher v3.0 to be able to use a JAVA_OPTS environment variable to set JVM arguments, patched version at https://blobfish.atlassian.net/wiki/display/WEB/2014/03/07/jPortable+Lau...

ollydbg23
Offline
Last seen: 2 months 3 days ago
Joined: 2008-04-12 03:11
Hi, blobfish, I just tried

Hi, blobfish, I just tried your patched jPortable Launcher today, I see the official jPortable Launcher is version 5.0, and your patched version is still 3.0.

Can you updated your patched version to the more recent ones?

Any way, I have asked John for the help, I mean why not just incorporate your changes?

See here: Launching Weasis via jPortable Launcher | PortableApps.com — https://portableapps.com/node/65031#comment-249487

EDIT: The reason I need to use this java portable launcher is that I would like to run this git tool:
BFG Repo-Cleaner by rtyley — https://rtyley.github.io/bfg-repo-cleaner/