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?
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
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
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
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
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.
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
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.
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...
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/