jPortable Launcher patch to receive JVM arguments

I have patched jPortable Launcher (http://portableapps.com/apps/utilities/java_portable_launcher) to allow to include JVM arguments in the execution of the JAR target file.

Usage is like this (tested on Windows):

sample.bat (do not use quotes around JAVA_OPTS value).

set JAVA_OPTS=-Xmx512m -Dtest=value
JavaPortableLauncher_3.0.paf_with_JAVA_OPTS_support\JavaPortableLauncher.exe myjar.jar

Patch has been done over jPortable Launcher Version 3.0 (JavaPortableLauncher_3.0.paf.exe). You can download patched version and use it right away from JavaPortableLauncher_3.0.paf_with_JAVA_OPTS_support.zip or you can build it by your own from the source in “Other/Source/JavaPortableLauncherU.nsi” (Instructions for building somewhere else).

Actually the only one modification in source is the following one (excerpt from patch file) to JavaPortableLauncherU.nsi:

SetOutPath $0
- Exec `"$PortableAppsPath\CommonFiles\Java\bin\javaw.exe" -Duser.home="$EXEDIR\Data\AppData" -jar "$JarPath"`
+ ; getting and including JAVA_OPTS
+ ReadEnvStr $0 JAVA_OPTS
+ Exec `"$PortableAppsPath\CommonFiles\Java\bin\javaw.exe" -Duser.home="$EXEDIR\Data\AppData" $0 -jar "$JarPath"`

Download patched version

Leave a Reply

Your email address will not be published. Required fields are marked *